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).
Related
I’d like to track certain Webflow events in Google Universal Analytics (using analytics.js) without the use of Google Tag Manager. The specific scenarios we are trying to track are:
PDF downloads
YouTube Video views from lightboxes, sliders and straight embeds
I added the JavaScript tracking snippet to the site-wide Head Code of my site, replacing the UA# with the real one.
<!-- Google Analytics -->
<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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
Do I just proceed with setting up Event Tracking on a per element basis or do I need to create a tracker?
If you create new trackers they might overwrite configuration options for the first tracker (if any), so that is not only unnecessary but potentially harmful (unless you want to track to different properties, in which case you'd use named trackers that do not interfere with each other).
For your use case you need only the default tracker and then you send an event for the elements the user interacts with.
You might also consider using gtag.js over analytics.js, since Google now gives gtag.js as the default code; documentation is much worse than for analytics.js and there are some doubts that it is feature complete, but Google is unlikely to roll back so I'd say gtag.js is more futureproof.
Gtag.js has some of the advantages of GTM (consistency between tags via the datalayer) without its main disadvantage (arbitrary code injection - GTM has been describes as "XSS as a service"), so it might make sense to go that route now.
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.
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.
My site www.katievb.com is a blog hosted by blogspot.com. I've created a Google Analytics account and registered a "Universal Analytics" property. It provided a unique UA ID and some code to embed in the HTML that looks similar to 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-XXXXXXXX-X', 'katievb.com');
ga('send', 'pageview');
</script>
I did this probably about 24 hours ago. The GA admin page has said "Status: Tracking Not Installed" this whole time. However, GA Real-Time actually does track my visits. (I can use Firefox on a Mac and in real-time see that on the Analytics screen, and then I can go over to a Windows computer with Chrome and visit katievb.com and see that on the real-time screen too.)
In blogspot's settings, I intentionally did NOT populate the Settings > Other > Analytics Web Property ID because it appeared to me that that would expect that I was using the old-style Google Analytics (ga.js) and not this new kind (analytics.js).
Also, I then replicated this in a completely independent pair of blogspot/GA accounts.
Why does it say "Tracking Not Installed"? It seems to be tracking, and I'm not sure what I'm supposed to change about how I installed it.
I've read the instructions many times and have tried different versions of their code and placing it in different locations, such as prior to </head> or </body>.
Eventually it started working. I think it took a day or 2 for the status to accurately reflect that tracking had been properly installed. It's bizarre... because Real-time was working, so I would have guessed that Google's status code would have been able to be updated real-time too.
It takes up to 72 hours to detect, but look in the Reporting section, Standard Reports, under Real Time, and it should show at least 1 active visitors on the site, which is probably you.
You can access to real time tracking.
To see Real-Time data, navigate to the Reporting tab and select Real-Time from the left hand report navigation column.
You will see 1 visitor if there were 1 visitor within the last minute.
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