How to install Visitor Analytics
On any HTML-website
It only takes a few minutes to install Visitor Analytics on your own website. Once installed, you will be able to get a clear grasp on your website traffic!
Note that the design and/or the process presented in the video is only informative oriented and it might be out of date. Make sure you follow the intallation steps mentioned below accordingly.
Here is how to install Visitor Analytics:
- Sign in to or register your Visitor Analytics account.
- Add your website url and select your timezone
NOTES: If you are registering a new account, you will fill in the website URL during the process. We recommend you to copy the URL address from the address bar of your browser. This way you make sure that the URL is complete and correct and includes the protocol, if the case.
- Copy the Tracking Code generated by our app and place it in the source code of your website, right before the closing </body> tag, then publish the changes.
NOTE: Depending on the website builder platform you have in use, se here further instructions on how to embed custom code within the source-code of your website.
- Go back to Visitor Analytics and Verify the Snippet installation.
- If everything has been successfully accomplished, you may visit your live site, then reload the dashboard's data to see your first stats.
- In case you will ever need to re-install the tracking code, you can find it in your Account Settings, or by simply checking the Tracking code notification icon from the right corner of the dashboard's header.
- After creating an account, an email will be sent to your inbox which contains all the necessary details. Do not forget to Confirm your account within 10 days.
- If you already have an account, all you need to do is to Add a new website to your account, starting to follow the instructions from the 2nd step.
- You can find detailled information on how to add your tracking code for any type of website in the video above or in our install guide depending on the platform your website is based on.
- Please, do not hesitate to contact our support directly, if you encounter difficulties at any of the steps!
PS: We are now part of the GTM (Google Tag Manager) community. You can add Visitor Analytics to your website directly through GTM.
How to integrate an event tag within your HTML website
Once you have generated your new event tag, you need to integrate it within your website, so that the application can track the firing of this event. Each created tag must be added within each individual element that you want to track.
It is pretty simple and there are various ways on how to do this:
Edit your HTML source-code and add the Event Tag to your desired elements.
You can add the tag our app creates for your event, either as a JS snippet or directly on the element, as per the tutorial below.
Here is an example for a button inHTML and how it should look like so that the click on that button is tracked as an event:
<button id="important-btn">Click me!</button>
Option A: JS snippet
<script> document.getElementById("important-btn") .addEventListener("click", function(){ va("send", "event", "example-category", "btn-click", "Important Button") }); </script>
Option B: directly on the element
<h2 onclick="va('send', 'event', 'example-category', 'btn-click', 'important', 123);">Important button</h2>
Both options are semantically correct and do the same thing in the ideal case.
However, Option A allows for more flexibility. For example you could add a "visa-track" class to multiple elements and call the va method in a more dynamic manner by relying on JS capabilities.
The limitation with Option B is that it might be overridden by some other JS code that is loaded after the DOM is rendered ( element.onclick = function(){ ... } ), thus causing our code never to be called.
In comparison, Option A allows an unlimited number of event listeners to be added (as long as the memory on the user agent device can withstand it).