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 tracking data Container

Follow these steps:

  1. Go to our System UI and create a user account.
  2. Contact our sales and ask for creating a Container for you.
    In the near future you will be able to create the Container for yourself... but it is not working yet that way...
    So for the time being just drop us a mail quickly at sales@keytiles.com, and we create your container for you!

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

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

Step 2 - adding the tracking script

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 "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!