AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
4.4K members online now
4.4K 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

Google Analytics tracking code not working9

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Google Analytics is not tracking one of my web sites. This one: http://shar.la/

 

I have three other sites that are tracking just fine - all are set up the same way. The HTML body holds the script that points to the PHP file. Any suggestions? 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Sharla G
July 2016

Re: Google Analytics tracking code not working9

Top Contributor
# 4
Top Contributor
Hi Sharla,

I checked your site again, your code is working, however it is recommended to be put it in the head section, before the closing head tag.

https://developers.google.com/analytics/devguides/collection/analyticsjs/

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

View solution in original post

Re: Google Analytics tracking code not working9

Top Contributor
# 2
Top Contributor
Hi Sharla,

The php code is not being rendered in your html file. It is simply output as text instead of being executed. You either need to change your html file to php or to set your web server to execute php code in html files.

Hope this helps.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Google Analytics tracking code not working9

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thank you Arnold.

From what I have read, parsing is not a good tradeoff given that this is the only section of php. I went ahead and put in the js. Not sure if this is the most efficient method. Thanks again for the response!
Marked as Best Answer.
Solution
Accepted by topic author Sharla G
July 2016

Re: Google Analytics tracking code not working9

Top Contributor
# 4
Top Contributor
Hi Sharla,

I checked your site again, your code is working, however it is recommended to be put it in the head section, before the closing head tag.

https://developers.google.com/analytics/devguides/collection/analyticsjs/

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Google Analytics tracking code not working9

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Thanks again!

Re: Google Analytics tracking code not working9

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
Hi Arnold,

I signed off on this too fast...
The snippet is not tracking in GA, when placed in the head tag. Any thoughts?

Re: Google Analytics tracking code not working9

Top Contributor
# 7
Top Contributor
Hi Sharla,

It is working perfectly, you can check using the Google Tag Assistant Chrome extension:

https://goo.gl/GfGYaq

There is always a delay in reporting, you should see the data appearing soon in GA.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Google Analytics tracking code not working9

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭
Hi Arnold,

That is a clever extension. I will wait to see what happens in 48hr Smiley Happy