In case you use the new version of Google Analytics — the 4th one, you should set up the numbers insertion script without attaching it to your Google Analytics script using GTM.

Firstly, check if you integrated the web page with Google Analytics 4 using Google Tag Manager.

Here's how you can do this:

  1. Go to your web page, click the mouse's right button, and select "View page source."

  2. When you see the web page code, click on Ctrl+F and enter "www.googletagmanager.com/gtm.js" in the search line.

  3. If you didn't find it, go to your GTM account and generate the script for your web page. Once you've done it, you can copy it and insert it into your web page code. Here're some tips for installing your Google Tag Manager code to the web page from Google.

  4. When you've set the GTM code to your site, create a new tag for setting Google Analytics on your web page via Google Tag Manager.

If you've already set the GTM script and published Google Analytics 4 on your web page, go to the next step and implement the number insertion script by creating a tag for it.

Setting the number insertion script using Google Tag Manager

  1. First, create a "Custom HTML" tag

  2. Copy the template of the adapted script into your tag:

    <script type="text/javascript">
    (function (d,s,u,e,p) {
    p=d.getElementsByTagName(s)[0],e=d.createElement(s),e.async=1,e.src=u,p.parentNode.insertBefore(e, p);
    })(document, 'script', 'https://script.ringostat.com/v4/ХХ/ХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХ.js');

    var pw = function() {if (typeof(ringostatAnalytics) === "undefined") {setTimeout(pw,100);} else {ringostatAnalytics.sendHit('pageview');}}
    pw();
    </script>
  3. Change the field https://script.ringostat.com/v4/ХХ/ХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХХ.js to the real link of your project script.

    You can find the link in "Call tracking" => "Script settings".

    and put it in your template.

  4. Set up the trigger "All Pages" for your tag and save the settings.

  5. Then publish the script on your website.

  6. After you published the adapted script on your website, go to "Call tracking" => "Script settings" in your project menu. And in the "User settings" field add the required setting "noGa": true,

    Don't forget to apply the settings. ;)

Did this answer your question?