Analytics Tracking Code

UKSBD

Moderator
  • Dec 30, 2005
    13,041
    1
    2,837
    Somebody wants me to add Analytics to their site but they don't know their tracking code.

    They know their UA- number.

    Can I just use any Analytics code and change the UA- number or is there other bits in the code that is unique too?
     
    Yep, just use the below replacing the red with their UA code.

    <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-xxxxxxx-x', 'auto');
    ga('send', 'pageview');

    </script>
     
    Upvote 0

    Onion4Sage

    Free Member
    Jan 5, 2015
    54
    3
    I had an issue with analytics recently where the tracking stopped working (on 22nd of November if I remember correctly). The tracking used a ga.js javascript file. The helpdesk advised to update to analytics.js and explained that the code snippet (including the correct tracking code) could be found in analytics at Admin | Property | Tracking info | Tracking code. I had to copy the code snippet and manually update my website. You should find your code snippet in the same place within analytics.
     
    Upvote 0
    Q

    qurttlfqrq

    UA Number is not changeable for websites. But this way you can find your tracking code.
    Sign in to your Analytics account.
    Select the Admin tab.
    Select an account from the dropdown in the ACCOUNT column.
    Select a property from the dropdown in the PROPERTY column.
    Under PROPERTY, click Tracking Info > Tracking Code.
    Image of where you find your tracking code in your Analytics account.
     
    Upvote 0

    Latest Articles