Google Tag Manager integration

You can use “Google Tag Manager” to add Analyzati’s tracking code to your website domain.
Follow this process if you’re tracking a domain name:

  1. In your Google Tag Manager account, click on “Add a new tag”
  2. Click on the “Choose a tag type to begin setup”
  3. Use the search functionality to search for “Custom HTML”
  4. In the HTML field within the Custom HTML section, paste the following Analyzati snippet:

    <script>
    var script = document.createElement(“script”);
    script.id = “ZwSg9rf6GA”;
    script.dataset.host = “https://app.analyzati.com”;
    script.dataset.dnt = “false”;
    script.src = “https://app.analyzati.com/js/script.js”;
    document.getElementsByTagName(“head”)[0].appendChild(script);
    </script>


  5. Be careful about extras you enable such as tag firing priority, tag sequencing, consent checks, etc as they all may affect when and how our script loads
  6. Then click to “Choose a trigger to make this tag fire”
  7. Select the “All Pages” and filter “Page View” as the trigger if you want to count all your pages
  8. Give your tag a name
  9. Click on the “Save” button
  10. Click “Submit” to submit your changes
  11. Then click on the “Publish” button

Track events using GTM

If you want to track events, modify your code and use the following (pay attention to highlighted code)

<script>
  function sendEvent() {
    pa.track({name: ‘ subscription’});

    var script = document.createElement(“script”);
    script.id = “ZwSg9rf6GA”;
    script.dataset.host = “https://app.analyzati.com”;
    script.dataset.dnt = “false”;
    script.src = “https://app.analyzati.com/js/script.js”;
    document.getElementsByTagName(“head”)[0].appendChild(script);
  }
  sendEvent();

</script>

Take note of this when using GTM:

Google Tag Manager adds complexity and some things can go wrong. Analyzati is very simple and we’ve made it so it’s easy to integrate and start counting visitors to your site. If you follow the above steps, Analyzati will work fine with Google Tag Manager. If you plan to use any more advanced options that GTM gives you access to, please make sure to verify and test the everything is tracking.

GTM allows you to select tag firing priority, tag firing options, tag sequencing and so much more. Deviating from the simple setup by adding any of the extras may affect the way Analyzati script loads and counts your traffic. It’s best to have in-house expertise and experience with GTM if you plan to use the more advanced options.

Do make sure to check the consent settings area of GTM so our script is allowed to fire when it’s supposed to. Please do tests in the browser console and ensure that our script is firing as intended when it’s live on your site.

GTM is blocked by many browsers and extensions!

Google Tag Manager script is blocked by several browsers including Brave, Firefox and Safari, and many browser extensions. This means that any scripts you’re using with Google Tag Manager will be blocked too by a certain percentage of your visitors.