google analytics re-marketing code not validated - google-analytics

So I've added this additional line of code to our Google Analytics tracking code so it supports display and remarketing campaigns as outlined by this help article https://support.google.com/analytics/answer/2444872?hl=en
However, within analytics, it still keeps showing that it's not been added. It's definitely in there and the rest of the tracking is working fine.
I am using Universal Analytics (analytics.js) and have added that one line to the existing code as shown
(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-53957342-1', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
Has anyone come across the same issue?
Any tips or advice would be helpful!
Thanks

Activation of this feature may take 48 hours. I recently did the same and added that code to my site and even after click on Validate, it would show as not active until two days later! With most things related to GA, you just need a little patience (usually). If by 48 or 60 hours later the code is still not active, then if you believe you have done everything correctly to implement it, then skip validation.
Hope this helps.

Related

How can we check analytics code of my site?

I am working on a site Local.mensusa.com. which is sob domain of www.mensusa.com.
I added a analytics code to my site but unable to get traffic on my site.
My code:
<script type="text/javascript">
(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-2085156-1', 'auto');
ga('send', 'pageview');
</script>
1: Is this the right code?
2: There is same code pattern for domain and sub domain?
Yes your code looks correct. If you want to be able to compare the data between the Doman and the subdomain then you should use the same tracking code. If you want to keep the data separate ex: two sites that have no relation to each other what so ever, than create a separate account for it.
Possible causes of your problem are.
When did you create the analytics account? it can take 48 - 72 hours for new accounts to begin recording data.
How long ago did you add that code to your site? it can take 24 - 48 hours for new code to start recording data.
Did you check the Real-time report? Standard reports take 24 hours to complete processing.
This tool is also useful for checking that your code is correct. Extension Google Analytics Debugger
It should be the right code. Otherwise, copy/paste it from the dashboard again.
In order to test it, you can easily check if you currently have visitors on your website: go to real time section.
Finally, about subdomain, you have to create another website to watch (with another google code) to track data.

Google Analytics code snippet incorrect?

I'm using the Universal Analytics instead of Classic.
The snippet is
(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-xxxxxxx-x', 'xxxx.com');
ga('send', 'pageview');
But the help pages I visited all referred to another kind of snippet. For example, this help page:
https://support.google.com/analytics/answer/2558867?hl=en&utm_id=ad
As a result, I don't know how to make changes to the above snippet to achieve what I want.
Is the difference in snippet code the result of using Universal vs Classic?
Enhanced Link attribution is not yet supported in UA (as are GDN integration/Demographics or Remarketings Lists via GA, even though the interface is already there). No clear timeline, but support is to come "soon".
Since Google plans a forced upgrade to UA for all accounts "soon" will hopefully be, ehm, sooner than later.

Google Analytics OnClick Event

I'm having some issues with my Google Analytics onClick events. I obviously have the google analytics code in the header:
<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-41953273-1', 'getafreephone.net');
ga('send', 'pageview');
</script>
Now my onclick on the hyperlink looks like the following:
<span class="calltoaction"><img class='alignleft_action' src='images/Forward.png' alt=''/>Click here to sign up today and receive your free iPhone!</span>
However, in Google Analytics it's not picking this up at all (it's picking all page-views etc up, just not events).
Any help will be appreciated, thanks.
I'm going to imagine after you click on the link, you have a error in the Javascript console.
The analytics tracking code you have seems quite old, and doesn't have the _gaq variable available to use. I would try upgrading the tracking code that is available t at https://support.google.com/analytics/answer/1008080?hl=en&ref_topic=1008079 which will give you access to _gaq.push().
Also take a look at the Google Analytics Debugger which logs a lot of useful information to the Javascript console and can help troubleshoot these issues instead of waiting 24 hours.

My Event Tracking inst working?

My event tracking isnt working on my Google analytic's. Below is the code that it gave me to insert into the webpage and below that is the snippet it told me to put. I am wanting to track the number of clicks onto a 'mailto' link from the website and I believe this is the best way to do it?
Can anyone tell me where its going wrong?
(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-37080107-2', 'promat-durasteel.com');
ga('send', 'pageview');
This is the snippet: (it wont let me put the opening tag on this forum for some reason, but it is there in the coding!
href="mailto:info#sharpfibre.com" onclick="_gaq.push(['_trackPageview, '/Direct-Email-Enquiry-Link-Clicked’]);">info#sharpfibre.com
Please help!
Thanks
As far as I can tell you are mixing two brands of Google Analytics - the new "Universal Analytics" and the , ehm, traditional asynchronous tracking code. Pushing values to the _gaq-Array will not help you since Universal Analytics does not use _gaq (and even if it would you are tracking a (virtual) pageview, not an event).
You'll have to use ga('send') on the click event. Documentation for event tracking with the new GA code is here: https://developers.google.com/analytics/devguides/collection/analyticsjs/events

google analytics experiments "No Google Analytics tracking code found."?

hopefully someone can help me out.
So l have a google analytics experiment running. However when l set it up and click the "validate code" button l get this error:
No Google Analytics tracking code found.
For both the original, and the variation page.
The thing is, l DO have the google analytics code on the pages.
One thing to note is that my google analytics tracking code looks a little different than most.
It looks like this:
<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-xxxxxxx-1', 'mysite.com');
ga('send', 'pageview');
ga('require', 'ecommerce', 'ecommerce.js');
</script>
Also it's important to note that the site is tracking visits properly in google analytics.
Can anyone help me out?
When I last checked (yesterday) Universal Analytics did not support (yet) content experiments (although it was announced support would be coming soon). I guess you opened a new GA account - new accounts are now set to Universal Analytics as default, you have to manually switch to the previous asynchronous version. However you cannot change this after you started tracking. IF this is a new account it might be feasible to lose the data already collected and start with a new account that set to the previous version.
Bottom line, you either have to wait with your test until support for content experiment is added or you start again with a new account (or you implement another account parallel to the current one and do your test from there, which to me sounds rather untidy).

Resources