On my website I have a Google Analytics scripts with my own trackercode. One of my clients, who has its own pages on my website, wants to be able to see pageviews of those pages in my websites under his own GA account.
I have tried the following code:
ga('create', 'My-code', 'auto');
ga('send', 'pageview');
ga('create', 'client code', 'auto');
ga('send', 'pageview');
But that doesn't seem to have the result I'm looking for.
Related
I am getting the below error in Google Analytics, suggesting I do not have the correct tracking code on my site, though I do. I'm using cookies-eu-banner, and have the below code on my site.
What could be causing this? If I visit the page this is logged in Google Analytics in the real time view, so it seems to be working but the error suggests something is awry.
Code
new CookiesEuBanner(function () {
(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', 'MYTRACKINGCODE', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['subscriptions.thestage.co.uk']);
ga('require', 'displayfeatures');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
…other tracking code…
}, true);
Error
The Ad Destination URL https://www.MYSITE from the AdWords account MYACCOUNT has accrued a significant number of clicks but a lower-than-expected number of sessions because the page is not tagged with a supported version of the Google Analytics tracking code.
If your pages do not include a supported version of the Analytics tracking code, then Analytics cannot collect data for those pages.
To find the right tracking code for your property, on the Analytics Admin page in the Property column, click Tracking info, then click Tracking Code.
Google Tag Assistant Recordings can help you ensure that your tracking code is sending hits as expected.
Instant Articles are configured a couple of months back. We have close to 300+ articles. Everything is working fine as long as Instant Articles is concerned.
I was not aware of the fact that GA doesn't track the page views from Instant Articles. I followed this https://stackoverflow.com/a/38112027/2657566 and added Global Site Tag.
This is my code. After saving it from Wordpress Instant Article Plugin's interface, when I open the Instant Article from my mobile, I dont see any active users.
Can you please let me know if am missing anything. Thanks in advance.
<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-XXXXXXXXX-X', 'auto');
ga('set', 'campaignSource', 'Facebook');
ga('set', 'campaignMedium', 'Facebook Instant Articles');
ga('set', 'referrer', ia_document.referrer);
ga('send', 'pageview');
</script>
Remove https:// and make sure the url is like this(if you’d ridge is not serving https requests) //www.google-analytics.com/analytics.js.
i had set up a google analytics account 3 days ago and i followed the instructions given from google analytics website. all goes well, but when i go to my google analytics account i can't see any visiting data. to be sur there is visitors i accessed my website from different places.
is it a matter of time or did i miss something ?
this is the Tracking Code
<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-68467341-1', 'auto');
ga('send', 'pageview');
</script>
a preview from my account
THANK YOU.
I have the same tracking code on my main site and on a subdomain.
(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-26266386-1', 'auto');
ga('send', 'pageview');
I now have a lot of traffic directly to my subdomain. but google analytics does not show the original referrer. it shows the subdomain itself as the referrer... how can i change that? do i need to use a seperat tracking id?
You can add your subdomains to the Referral Exclusion list: https://support.google.com/analytics/answer/2795830?hl=en
I currently have universal analytics setup and have implemented enhanced eCommerce on our site.
I've used Google Tag Assistant and the analytics debugger in Chrome and all my tags look fine and seem to send with no errors.
Is there any other reason why I wouldn't be seeing any transactions in the GA dashboard under eCommerce?
Here is what is sent when I do a purchase transaction:
ga('create','UA-xxxxxxx-xx' , 'auto');
ga('require', 'displayfeatures');
ga('require', 'ec');
ga('ec:setAction', 'purchase',{"Id":"33483","Name":"Bar","Brand":"Foo","Category":null,"Variant":null,"Price":27.00,"Quantity":18,"Coupon":"","Position":0});
ga('ec:setAction', 'checkout',{"Step":4,"Option":""});
ga('send', 'pageview');
EDIT:
I forgot to add I am testing this from localhost using cookiedomain : none