Getting started with Keytiles

Let's see what you need to do if you want to add Keytiles tracking to your page!

Content of this page

Step 1 - you need a user account

Follow these steps:

  1. Go to our System UI and on the login page hit "Create an Account" button.
    note: don't worry, you can also delete you account easily if you want to get rid of us :-P
  2. Complete the form and submit.
  3. Complete the process by following instructions in the e-mail.

Step 2 - you need a tracking Data Container

Before you start you might want to take a quick look on our Data Tracking - Terms & Conditions too

Follow these steps:

  1. Go to our System UI and login with the user account you want to become the initial admin of your new Data Container.
    note: later you can delegate permissions to other users of course so don't worry about it too much right now.
  2. Go to Data Containers page (menu on the left side) and hit the "Create Data Container" button on the top right side.
  3. Fill up the form
    • Data container name: give it a name you will recognize in your list the best (you can rename it later)
    • Tracked domains: You need to give at least one domain name (you can give more) your container will accept tracking data from. 
      For example:
      • If you have https://www.mywebsite.com its enough you give in "mywebsite.com" as domain name - the "www." prefix you can leave out.
      • However if you have your website on a subdomain like https://mywebsite.someprovider.com then you should provide "mywebsite.someprovider.com"
      • If your website is available under multiple URLs then you should list all of them accordingly - following the examples above.
  4. When you submit the form the system sends you a confirm code (we call it "token") via an e-mail.
  5. Follow the instructions in the e-mail to complete your Data Container creation.

Once you completed the above you will have the container under your user account!

Your new Data Container will start it's 30 days Free Trial period immediately right after you created it! So it makes sense to continue to the next step and add the Tracking Script to you website as soon as possible!

Step 3 - adding the tracking script to your website

First of all you will need to know the URL of your tracking script. Which looks like this:

https://scripts.keytiles.com/tracking/<your-container-id>/stat.js

You find your container ID on the UI. Just log in to System UI, go to Data Containers - the ID is just below the Container name!

It is strongly recommended that you always include the script with the above URL directly from our servers! Do not download and place it on your own webserver as that way service might break or might not work properly if we make any changes or adding new features! 

Adding to the <body> with small code snippet

Add the following snippet to the <body> of your page - preferably right after the <body> tag!

<script type="text/javascript">
	(function () {
	  var kt = document.createElement('script');
	  kt.type = 'text/javascript';
	  kt.async = true;
	  kt.src = document.location.protocol+'//scripts.keytiles.com/tracking/<your-container-id>/stat.js';
	  var s = document.getElementsByTagName('script')[0];
	  s.parentNode.insertBefore(kt, s);
	})();
</script>

Alternative ways

One possibility is to add the tracking script with Google Tag Manager - if your site is using that. Simply just add a Script to the page, using the URL described above! But!

This way the script will generate the hit on page load only - good enough for traditional "1 page - 1 content" websites. But will not work properly for "rich client" based websites (e.g. built with React or others) or "one-pager scrolling" pages!

But no worries, keep reading and learn how to deal with those!

Learn more advanced techniques!

The above basic injection will just generate a hit once / page load - using the attributes of the page itself.

If you have a traditional "1 page - 1 content" website then you should definitely read now our Adding <meta> tags - stop Keytiles guessing article!

There are many scenarios now days when a content visit is not happening (or not only) on page loads...

Do you have "one-pager" pages? Is your site loading content dynamically into the page? Built as a "rich client" using frameworks like React or others? Then you would need to programmatically fire hits using JavaScript then you should continue to our Advanced tracking script techniques article!