I have tried to make cross domain tracking work between my website and FastSpring for a month but can't find the problem. I tried lots of variations of the code an nothing seems to work.I also contacted FastSpring support but their answers didn't fix the problem
I suspect it may be a problem of my site using GaTracker while FastSpring uses GA but I really don't know. I checked with Google tag assistant and cross domain tracking sometimes work but not always, it's strange.
I'm trying to get it to work from this page:
https://frenchtogether.com/course/
window.ga = __gaTracker; __gaTracker('create', 'UA-43334717-1', 'auto', {'allowLinker':true});
__gaTracker('set', 'forceSSL', true);
__gaTracker('linker:autoLink', ['fastspring.com'] );
__gaTracker('set', 'anonymizeIp', true);
__gaTracker('require', 'displayfeatures');
__gaTracker('require', 'linkid', 'linkid.js');
__gaTracker('send','pageview');
Any idea what's wrong? Thanks
Related
I'm using the Google global site tag (gtag.js) to manage my tags, and I use it for Google Analytics.
Sometimes there is an email address in URLs on my site, and I need to remove that from the code.
I know there are clever ways to get this done when using Google Tag Manager. But I'm not using GTM, I'm using gtag.js. (This simple page explains the difference.)
How can I check the current page's URL for email addresses and fix that, before the URL is tracked by gtag.js?
(I know how to do the regex etc... this is more asking where in the flow can I grab the URL and 'rewrite' it as needed before the Analytics pageview event posts?)
I looked through the gtag.js API reference without much luck. Also looked at the docs for how Analytics implements gtag.js, still no luck.
Indeed Google's documentation can be hard to explore sometime since they describe stuff only once for better maintenance and consistency, but at the end you could be missing a working summary ...
I would suggest to use this https://developers.google.com/analytics/devguides/collection/gtagjs/pages
gtag('config', 'GA_MEASUREMENT_ID', {
'page_path': '/pagepath?email=redacted#example.com'
});
I'm changing google analytics for google tag manager on an existing website. This website also uses google e-commerce, so I have a few custom ga() calls related to the e-commerce being done on some pages.
The problem is that because the google analytics script loads asynchronously, ga() is not defined anymore when I'm trying to send some e-commerce related data.
I've found a workaround somewhere:
window['GoogleAnalyticsObject'] = 'ga';
window['ga'] = window['ga'] || function() {
(window['ga'].q = window['ga'].q || []).push(arguments)
};
But, although I've not the "ga is not defined" problem anymore, it still doesn't work.
I don't see anything on the google dashboard. I also don't see anything on the debugging messages (in the developer console).
What seems to be happening is that the GA script loaded with GMT is not using these variables I've set but I'm not sure how to fix it or if it is even possible to keep using my ga() calls with GMT.
I know that I can do it with dataLayer but I'm trying to avoid to rewrite a bunch of working code just for this.
I have seen an implementation that does it like this:
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', UA-XXXXXXXXXX, 'auto');
ga('require', 'ecommerce');
maybe that works out for you as well.
if you use enhanced e-commerce then the code below the "ga('create..." hast to change from:
ga('require', 'ecommerce');
to:
ga('require', 'ec');
The order is important here, events can be send after those functions.
I've got an email campaign that Im trying to track with Google Analytics, but for some reason the source, campaign etc are not being tracked.
The URL I'm using is:
https://makemeacocktail.com/list/14911/wimbledon-cocktails/?utm_source=mailinglist&utm_campaign=weeklynewsletter&utm_term=wimbledon
I've obviously got some htaccess rules kicking in that change the php _GET variables, but that shouldn't really matter here (I dont think).
My GA tracking code is:
const dimensions = {
TRACKING_VERSION: 'dimension1',
CLIENT_ID: 'dimension2',
};
const TRACKING_VERSION = '1';
ga('create', 'UA-22275118-1', 'auto');
ga('set', 'transport', 'beacon');
ga('set', dimensions.TRACKING_VERSION, TRACKING_VERSION);
ga('send', 'pageview');
ga((tracker) => {
var clientId = tracker.get('clientId');
tracker.set(dimensions.CLIENT_ID, clientId);
});
and passing the GA script through using:
<script async src="https://www.google-analytics.com/analytics.js"></script>
(This can all be seen in the source). Am I doing something fundamentally wrong?
Thanks in advance
Here are a few thoughts to troubleshoot this:
Install the Google Analytics Debugger in Chrome and verify your pageview is triggering when the campaign URL is there. You'll be able to see individual dimensions and metrics too (so you can check you custom dimensions too).
It seems like you're implying that the pageviews are working, but I wanted to include this just for due diligence.
Looks like you're relying on ES6 and the beacon to send data. That should be fine, but if your users are on older browsers that may prevent the data from coming through.
UTM campaigns require a utm_campaign, utm_source, and utm_medium to be valid. This does not prevent them from sending, but I'd recommend updating your campaign URLs if possible (you're missing utm_medium).
Are you using a filtered view? If so, your own traffic won't appear in the reports.
Are you using the Real Time reports? If not, you'll need to wait a few hours before the data becomes available in the Google Analytics standard reports.
Hopefully one of those steps gets you pointed in the right direction. Best of luck!
Edit: Viewing the source of that link you provided, I don't see your Google Analytics snippet in there. Maybe you're working on it now, but try viewing the page in an incognito window and check the source (maybe your script is tied to an admin or dev user?).
I'm stucked on copying google analytics tracking code issue. It looks like Google Tag Assistant doesn't consider the code I copied from the generated GA tracking JS for the site.
The site is in http://www.orchid.co.nz/
I added the codes on the header. This should work correctly like what I'm doing with the other sites I worked with. However, this one is weird. I can't figure what's wrong.
Anything I missed?
This error is caused by Cloudflare as it implements rocketscript to speed up the web load speed. Disabling the cloudflare will fix this but you don't need to do that. There is simple code to make cloudflare ignore that particular javascript code.
Simply Change
<script type="text/javascript">
to
<script type="text/javascript" data-cfasync="false">
This is most efficent way..
Thanks :)
Not sure if this will fix the issue, but you are telling the browsers to parse the script as "rocketscript":
<script type="text/rocketscript">
(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');
....
I don't know what rocketscript is and I guess neither does the Tag Assistant. Try to change this to "javascript" or not to use a type attribute at all.
Here is a discussion about rocketscript, apparently this is part of some Cloud technology and requires a special plugin in Wordpress.
I see tracking calls in the network tab of the browser, so it looks like the problem might very well be purely cosmetic (altough chromes GA debugger extension does not pick up the calls, either).
it might be late but the solution for this is :
adding the option data-cfasync="false" in your analytics.js.
this has to do with cloudflare
Seee reference here
http://www.aodba.com/fix-redundant-hostname-warning-google-analytics/
The quick solution.
If nothing works with the code:
Turn off the feture.
Menü:
Speed ->Rocket Loaderâ„¢ BETA -> Off
I have attempted to find this questions answer on this site and a few others. But it does not appear to be working for myself. The following url shows explainations on how to use GA and UA together.
How to use both ga.js and analytics.js?
I've tried this example, with the same account and property (but separate property of course), I have tried this with different accounts but I am constantly only getting 'real-time' hits from the first analytic that is ran. Ie, if I put UA then GA, UA only reports live hit, and visa versa.
Additionally I am getting a message on the screen saying "More than one Google Analytic's scripts are registered. Please verify your pages and templates. "
Sad part is when I Google this, I get many results, but they are all sites that are showing the same symptom :(
Tia Charles
Make sure that your not using the same Tracking ID You need to log them to different web Properties.
_gaq.push(['_setAccount', 'UA-xxxxx-y']);
ga('create', 'UA-xxxxx-z', 'yoursite.com');
Notices how one has 'UA-xxxxx-y' and the other is 'UA-xxxxx-z'