W
W
weranda2018-07-22 11:51:47
Google Analytics
weranda, 2018-07-22 11:51:47

Where can I find the counter code in Google Analytics?

Greetings
, I removed the Google Analytics counter code from the site, logged into my Analytics account and now I can’t find a place to copy this code. I've been pushing buttons for half an hour. Where is he?
PS
Found the code:

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXXX"></script>
    <script>
    window.dataLayer = window.dataLayer || [];

    function gtag() { dataLayer.push(arguments); }
    gtag('js', new Date());

    gtag('config', 'UA-XXXXXXXXXX');
    </script>

But is he, I remember, he used to be completely different (example from another site):
<script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-XXXXXXXXXX', 'auto');
      ga('send', 'pageview');
    </script>

So now I don’t understand - did they change the code or hide it somewhere, what can you find?!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mirexdoors, 2018-07-22
@weranda

Администратор->Отслеживание->Код отслеживания

M
Mario62, 2020-01-27
@Mario62

Google has moved its analytics from using the analytics.js script to the gtag.js script.
Therefore, now for inserting into the site, Google offers the version of the code that comes second to you. Your first option continues to work, but it is recommended to switch from it to the new option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question