Options

Where does the Universal Analytics tracking code go?

ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
edited January 15, 2014 in SmugMug Support
Where do I put this new, html-y, long, new-format looking code?
GA gave me a message that my old Tracking ID would be replaced with a new one once the transition to Universal Analytics was complete. However that ID no. is identical. So the replacement is supposed to be the code below.

Please let me know what to do and where.
Website trackingThis is the Universal Analytics tracking code for this property. It’s different from the classic Google Analytics tracking code. To get all the benefits of Universal Analytics for this property, copy and paste this code into every webpage you want to track.

<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','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-123456780', 'joinrats.com');
  ga('send', 'pageview');

</script>

Comments

  • Options
    JohnHeroJohnHero Registered Users Posts: 110 Major grins
    edited January 15, 2014
    Hi,

    You do not need to enter the entire script on SmugMug. You will want to login to your site, click on ACCOUNT SETTINGS > STATS > GOOGLE ANALYTICS and enter your UA code, found in the script above. It is UA-123456780

    If you need anything else, please let us know by going to help.smugmug.com and clicking the "Email Us" link

    John
    SmugMug Support Hero
    John
    SmugMug Support Hero
  • Options
    ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
    edited January 15, 2014
    Thanks John. Would there be any advantage to adding that long HTML code to an HTML block in All Galleries, or All Folders, or individual galleries?

    Because I had added old java to the header in Legacy, that 'broke' stats. Would adding this code anywhere, cause the same problem?
  • Options
    bwgbwg Registered Users, Retired Mod Posts: 2,119 SmugMug Employee
    edited January 15, 2014
    ChancyRat wrote: »
    Thanks John. Would there be any advantage to adding that long HTML code to an HTML block in All Galleries, or All Folders, or individual galleries?

    Because I had added old java to the header in Legacy, that 'broke' stats. Would adding this code anywhere, cause the same problem?
    heh, not really. thats javascript and as such would be stripped out of an html block.

    I honestly have no idea how you converting your analytics to universal will behave since we still use the ga.js tracking code (not the universal anayltics.js). Is your UA-code the same?
    Pedal faster
  • Options
    ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
    edited January 15, 2014
    bwg wrote: »
    heh, not really. thats javascript and as such would be stripped out of an html block.

    I honestly have no idea how you converting your analytics to universal will behave since we still use the ga.js tracking code (not the universal anayltics.js). Is your UA-code the same?

    Yes, it's the same code.
    GA said everyone will be required to upgrade to Universal Analytics at some point. This is what I see.

    The link for info:
    https://developers.google.com/analytics/devguides/collection/upgrade/?hl=en_US

    Down in that page is another link about the differences in the javascript.
  • Options
    ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
    edited January 15, 2014
    I have a feeling I have indeed shot myself in the foot by transferring to universal analytics.

    Could Smugmug please take a look at this page:

    https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs

    and since more and more people may just upgrade automatically, because that's the message they see in GA, tell us what will happen, or what the plan is for shifting SM to UA? And maybe post a Caution all over the place about what not to do?

    Thanks.
  • Options
    bwgbwg Registered Users, Retired Mod Posts: 2,119 SmugMug Employee
    edited January 15, 2014
    ChancyRat wrote: »
    I have a feeling I have indeed shot myself in the foot by transferring to universal analytics.

    Could Smugmug please take a look at this page:

    https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs

    and since more and more people may just upgrade automatically, because that's the message they see in GA, tell us what will happen, or what the plan is for shifting SM to UA? And maybe post a Caution all over the place about what not to do?

    Thanks.
    From what I can gather from their documentation, continuing to use the ga.js code will work fine even though you have upgraded to universal. you just won't be able to use the new features that universal offers. However we can't switch over to universal until *everyone* is migrated to universal, so once Google pulls that trigger we can update our end.
    Pedal faster
  • Options
    ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
    edited January 15, 2014
    Thanks, O Ill Unicorn Rainbow.
    500 hits today in GA, either shortly before, during, or after the transition to UA.
    I will see what happens tomorrow/over time as a comparison.
Sign In or Register to comment.