Analytics
2.1K members online now
2.1K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

GA Code positioning when Non Standard Implementation

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi Team

I have added my Google Analytics code to my site layouts/theme.php file just above the <head> as directed by Google. Which was all fine.

However using Google tool Tag Assistant I'm told by Google I should move code higher into the html after getting "Non Standard Implementation" messages on some pages when testing pages with Google Analytics.

It seems some scripts are being loaded before GA code fires so I'm possibly missing out on some traffic recorded.

Apart from the layouts/theme.php file, where else specifically (another template file?) could I rather add the GA code for it to be the highest loading script?

Any ideas?

1 Expert replyverified_user

Re: GA Code positioning when Non Standard Implementation

Top Contributor
# 2
Top Contributor
Hi David
That's completely dependent on what CMS you're using or how your site is set up. I'd recommend you speak to your developer or ask on the support forum of whatever CMS your are using.

Alternatively, you might want to look at Google Tag Manager which will take care of that for you.