I track a main domain and subdomain in one Analytics property. I have a shared profile and also subdomain-specific profiles using the Hostname filter.
I prepend /blog to the URLs on blog.domain.com because it gives good and readable reports on the shared profile (compared to displaying the full URL).
www.domain.com is http-only, blog.domain.com is https-only.
Tracking code on www.domain.com:
_gaq.push(['_setAccount', 'UA-XXXX-1']);
_gaq.push(['_setDomainName', '.domain.com']);
_gaq.push(['_trackPageview']);
Tracking code on blog.domain.com:
_gaq.push(['_setAccount', 'UA-XXXX-1']);
_gaq.push(['_setDomainName', '.domain.com']);
_gaq.push(['_trackPageview', '/blog/article-title');
Problem is, only about 2 out of 15 daily pageviews from the blog show up in the reports.
Using the Chrome GA Debugger I can see that the tracking beacon is sent. The GA live view also seem to show all these pageviews. There are only one set of GA cookies (.domain.com), and I can see the the counters in the cookie increment on each pageview.
I also have a _trackEvent on the blog that have incomplete statistics. But for some reason, my eCommerce tracking seems to be complete.
Any reason that tracking pageviews and events for blog.domain.com should not work in the above case?
Related
I am having trouble tracking without cookies using GA4.
I have both a UA and a GA4 property that I am tracking simuntaniusly using gtag:
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag("consent", "default", {
ad_storage: "denied",
analytics_storage: "denied",
wait_for_update: 1000
});
gtag('set', 'url_passthrough', true);
gtag('js', new Date());
gtag('config', 'UA_TRACKING_CODE');
gtag('config', 'GA4_TRACKING_CODE');
Both UA and GA4 complies with consent set to "denied" and are not setting any cookies.
In UA i can see the pageviews coming in even though no cookies are beging set. But nothing is tracked in GA4 unless i set the "analytics_storage" set to "granted".
Does anyone know how to track in GA4 with "analytics_storage" set to "denied"?
With the Consent Mode it doesn't even track Universal Analytics if analytics_storage is denied (you can see that the data is sent to the Google Analytics servers but none of those hits will be shown in the reports).
This subject is very confusing and frustrating for me as well.
In short - I believe GA4 won't let you track ANY information without user consent (not even aggregated, anonymous information).
Here's some documentation, that I don't think was available when this question was asked:
https://support.google.com/analytics/answer/9976101?hl=en
Spesificaly:
analytics_storage='denied'
...
Cookieless pings will be sent to Google Analytics for future measurement. Google Analytics 4 will use cookieless pings for modeling.
I tested it, and that's indeed the behaviour I see when analytics_storage and ad_storage are 'denied':
No cookies are set
GA sends a ping for every pageview (i have set-up a server-GTM, so the ping goes there - and from there to Google)
The pageview-ping does not show in:
real-time report
normal reports (not even after 24h - some posts I've seen said it takes 24h. but it doesn't. It's never visible in reports)
Not even in DebugView (a GA4 feature)
Sadly, I couldn't find statistics about consent-preferences - how many people accepted/rejected each storage option
I think GA4 went too far here -
I just want to track aggregated, anonymous data, when users reject cookies. That's not PII at all. I just want to know stuff like "how many people have visited this page in my site". That shouldn't be banned.
But seems like it is, and I've yet to understand why or how to get around it.
I know GA4 sends a parameter called gcs (Google Consent Status) with the ping. presumably, in my sGTM, I can send my ping without this parameter, or set it to G111 (= 'permissions granted'), and maybe that would make the pageview count in reports, but so far I wasn't able to override this parameter - not in GTM, nor in sGTM (Server-Side GTM).
If anyone knows a solution to this situation - I'm more than happy to hear.
So I am working with a third party self-contained landing page for a client but I would like any conversions on this site to be tracked to the client's website's google analytics account (or GTM). So, for instance, when the form on the landing page gets submitted, it would fire an event on GA, or when the user downloads a pdf from the success page.
there was a link() function in ga.js, but there doesn't seem to be an equivalent in analytics.js
Just need an example of the code and where on the landing page should it go?
For GTM, use tracking form submission events
On the PDF download event, set up an event tag for when they download the PDF.
Note, if the third-party landing page is on a different domain, you will need to setup cross-domain tracking to ensure your traffic information is correct.
Google Analytics collects and aggregates data based on tracking ID (some like UA-123123-1). Data collection is realized over the HTTP request to https://www.google-analytics.com/collect endpoint with tracking ID as an URL parameter. There is no built-in limitations for analytics data to be sent from different domains. So you may send a proper request from any 3rd party page or server and this will be tracked within a client's google analytics account. You only need to know client's tracking ID.
Within your page you may just place a common analytics snippet
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_TRACKING_ID');
</script>
and replace the GA_TRACKING_ID with client value. Note that only location.path would be reported in the client's Google Analytics.So if your landing page doesn't have the path part it may be mistakingly reported as the main page / of the client's site. To prevent this you may use some arbitrary values to be used in the report and pass them as a parameters with gtag(...) call:
gtag('config', 'GA_TRACKING_ID', {
'page_title' : '3rd party landing page', // will be used in reports
'page_path': '/landingpage' // will be used in reports
});
We are using GA with GTM to track an Ajax-based website.
We are tagging a pageview tag with some of the events (gtagChange in this case) to track the pageviews.
When I visit the page, my pageviews are not tracked in the real-time reports.
Anyway, I see some other users from other countries, I visit the same content than them to check if it is a failure of the tag in some pages, but I don't still see my visits. I have asked some colleagues in the same office and it happens the same.
I have tested the same with other Ajax-based site using also events to track the PV (https://lite.rwlabs.org/) and it tracks my visits in real-time.
I have seen with the GTM preview that the tag is firing and checked with the Google Tag Assistant that the tag is there. We don't have any filters for that GA property/view.
The site is https://www.redhum.org/ , the GTM code is GTM-TSLB63K and our GA code is UA-102874553-1
Any clue why this site and only this site is tracking only some of the visits?
Thanks/
Have a lot of client sites that use a similar system of their primary domain with an external checkout software hosted elsewhere. Their analytics is filled with self-referrals from the primary domain. For example.
I have a primary domain in which I have entire control. This has a Google Tag Manager implementation using Universal Analytics. The secondary domain, a booking system, uses classic analytics.
I have no control over how the analytics on the booking system is implemented (aside from setting the tracking ID), but the developers say it is setup to use cross-domain tracking. Their implementation has:
_gaq.push(['_setAccount', 'UA-67867867-1']);
_gaq.push(['_setDomainName', 'www.seconddomain.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setCookiePath', '/properties/abcd']);
_gaq.push(['_trackPageview']);
_gaq.push(['_cookiePathCopy', '/reservations/abcd/']);
My understanding is I need to configure GTM to mirror these settings as per the "Inconsistent Tracking Code Configuration" directions at: https://support.google.com/analytics/answer/3198398?hl=en
In GTM, "Allow Linker" is set to true. "Auto Link Domains" has "primarydomain.com, seconddomain.com", but this seems pointless as GTM is not on the second domain. "Cookie Domain" is auto.
Self-referrals still happen. What am I missing?
Unfortunately, the cross domain implementations in analytics.js and ga.js are incompatible with each other. The booking system will need to upgrade to analytics.js (or you will need to downgrade to ga.js).
To get rid of referrals from the booking system, follow these instructions: https://support.google.com/analytics/answer/2795830
Just noticed the following message in google analytics "Property xx is configured for Ecommerce, but no transaction data is being received. Your site may not be tagged for Ecommerce."
The site has had ecommerce data for several years using GA although we plan to upgrade to UA very soon. We haven't made any changes to the site or GA snippet. Has anyone else received this message or can shed any light as to why?
Thanks
Ninjasys,
You also have to send the website's transaction data with the other information in your google analytics tracking data.
E.g.:
_gaq.push(['_setAccount', 'UA-XXXXX-X']); // This must be the ID of the Google Analytics account to send the data to.
_gaq.push(['_trackPageview']); // Sends a page view to Google Analytics.
_gaq.push(['_addTrans',
The full code you can find here