Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Using latest GA library with store
Hey everyone,
The NetSuite Help on "Working with Google Analytics" (https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N2653735.html#prettyPhoto/-1/) includes code for ga.js, the legacy library, not the latest analytics.js library. Has anyone found official documentation for using the latest analytics.js library?
I found this guide, but it's a couple years old. http://www.fourthwc.com/netsuite/2014/02/installing-google-analytics-universal-netsuite-websites.html
I setup everything based on the above guide:
ADDITION TO <HEAD>:
&lt;script&gt; (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-XXXXXX', 'auto', {'allowLinker': true}); ga('require', 'linker'); ga('linker:autoLink', ['mystoredomain.com', 'checkout.netsuite.com']); ga('send', 'pageview'); &lt;/script&gt; 0