Tracking traffic of individual microsites Google Analytics - google-analytics

I have a web site which has many microsites.
I want to use Google Analytics to track the traffic of each individual Microsite as opposed to tracking traffic of the whole site?
I have looked at Google Tag Manager, but I am not sure if this is the right solution - how can this be done?
Thanks

There's two basic ways in which this can be done:
If you don't care about inter-microsite traffic, you can just create a different GA property for every microsite and use Google Tag Manager to create your GA tracking tag with the right property ID depending on the hostname (using a lookup table variable, for example).
If you want to be able to see traffic flow between your microsites (i.e. not have a visitor navigating from one site to another show up as a referral but as the same session), then you should use the same GA property for all sites and set up cross domain tracking. Then inside your GA property, you can set up different views based on the hostname dimension of the hits.

Related

I need to measure traffic from root domain to subdomain as Refferal - GA4

I need help with the following case. My client has a website where the catalog and product informations is on the main domain https://fixed.zone from the product cards links to the eshop which is on the subdomain https://obchod.fixed.zone
I need the person who clicks through from the root domain to the eshop to be a referral in GA4. It now appears as Direct.
Can anyone advise me how to achieve this? The GA4 code is only on the eshop. It is not on the catalog page. I didn't set up the analytics on the main domain but someone else did. However, I can also intervene in the website on the root domain
I tried to google the solution but it seems to be kind of rare set up
Referral attribution is something you typically don't touch. It's something Google comes up with on its own. If this dimension doesn't do the trick, you just use a different dimension, like the actual referrer, or a segment where you select sessions that have both hostnames.
Still, there is a way to trick GA. A few ways, actually. For example, you could have logic in GTM that would run on subdomain that would check user's document.referrer on every hit before sending pageview. Once the referrer is from the TLD, you override the referrer dimension in the call and replace the TLD in it to something else, that way those hits will look like they came from a different TLD and will be treated as referral traffic.
Or you could issue an event every time a user navigates to the subdomain, so you could just look at those events.
Same issue here. Managing a GTM container and GA4 property for a subdomain that is separate from main domain. By default in GA4, it appears as though the main domain traffic is lumped in with direct traffic rather than a referral. We need isolated referral data from main domain to subdomain in GA4. Lumping the traffic into direct will not work for us. The UA property for the same subdomain lists the traffic from the main domain as a referral.
I created a GTM GA4 event tag for traffic tracking.
parameter name: referrer_URL
value: {{HTTP Referrer variable with component full URL}}
trigger: Page View - trigger fires on: {{HTTP Referrer variable with component full URL}} does not contain "my.subdomain" (to exclude self-referrals)
created custom dimensions in GA4 for new parameter "referrer_URL" so it will be visible in reports
After approx 24hrs my new custom dimension started showing up in reports.
In GA4 reports->Acquisition->Traffic acquisition click the "+" next to first column header of "session default channel group" and select custom->"your.custom.dimension" (or search for your custom dimension). Default channel groups should be broken down further into your custom dimension urls.

Google analytics - allowed hosts

I'm seeing entries in my analytics data for pages that no longer exist.
This could be developers looking at legacy versions of a site, it could also be triggered by something like wayback machine.
Is there a way to either identify what hosts an analytics tracking pixel is being triggered on, or restrict analytics to only execute on either a set of domains/hosts or ip address
LinkedIn campaign manager and Hubspot have features where you can tell the tracking script what domains to include/exclude
This is different from excluding ip addresses when setting up filters
Thanks
you can use filters on view level (Universal Analytics, not GA4) in order to exclude or include specified domains to ga data. Keep in mind, adding or removing filters work for new collected data only. Maybe add an additional view, so one view contains all data (based on your ga setup). With this solution GA collects data but will not show the data in the filtered view.
In order to fire the ga tag on a specified domain, specify the host in the trigger in Google Tag Manager, if it is implemented on page. This setting the tag will not be fired on other domains.
If there is no Tag Management on the page, you can check the domain using js before firing the ga script.
Keep in mind, that it is possible to send data to GA without fireing the GA tag by using Measurement Protocol. So if a lot of spam data appears in the interface, may add additional filters to exclude this data aswell.

Google Analytics with Google Tag Manager not reporting properly on subdomains

I have a site with 3 subdomains with the same Google Tag Manager and Google Analytics tracking ID. I created 3 views on the property, I applied the proper inclusion filters so I can focus each view on its counterpart subdomain.
GTM is firing GA on the three subdomains and the GA debugger is showing that it is tracking (I tried recording and it worked, I tried GA plugin and there are no errors).
The problem: One of the subdomains is reporting everything (all subdomains)! Even with the proper inclusion filter in place. The 2 other subdomains are reporting nothing.
Note that my inclusion filter is equal sub1.example.com (and the same view is reporting on sub2.example.com and sub3.example.com)
I spent 6 hours so far, reading documentation and trying different options to no avail.
Why would be a filtered view for one subdomain show stats for the other subdomains? Why would the other subdomains show nothing? Would this be related somehow to GTM?
GTM id is the same across the domains and not duplicated and matches the account number
GA snippet is not included on the pages and the id is double checked
The three subdomain settings are exactly the same with only the inclusion filter being different
Make sure that you disable UserId Tracking when you create a View.
Enabling UserId Tracking will exclude all analytics without it being set.

Cross Domain Tracking - see original source in Real-Time Reports

I have set up Cross Domain Tracking for two different domains with two different GTM containers. I added both domains, a.com and b.com in the Auto Link Domains in both Universal Analytics tags, set Allow Linker for both to true and set Cookie Domain to auto. However, when I'm surfing from Facebook to website a.com and click through to b.com I see a.com / referral as a traffic source in the real-time reports in Google Analytics. This should be Facebook in this case right? Does someone have a method to debug this issue?
Thanks!
Use Referral Exclusion List in Property Tracking info. This will exclude traffic from a.com from referrals.
Possibly you are not a Google Analytics Premium member?
The second thought is maybe you are using two Google Analytics properties (one for each domain) and not using one property for both domains?
To be able to utilize the cross domain function you must have one Google Analytics property associated to all domains. You might have the results of funny "referral sources" because you are using two different properties (UA-1111111-1 and UA-2222222-2.
Read more about multiple cross domains
Or for specific cross domain info (notice the part about "UA PROPERTIES)
Let me know if that is the issue, and what your next strategy might be.

Can I use Google Tag Manager to collect analytics from mulitple domains?

The set-up:
1 site, 2 domains: = mysite.com and mysite.co.uk
These 2 domains use DNS to point to the same site (IP).
There is 1 snippet of Google Tag Manager (GTM) code just after the opening <body> tag of the site (every page).
In the GTM container, I have added both domains on the "Container Settings" page.
There is one Google Analytics (GA) account which only contains the .co.uk domain. (An analytics account can only contain 1 domain.)
A tag has been set up in GTM with the type of Google Analytics and it has the UA code from the 1 GA account added.
A rule has been added to fire on all pages
Now, I don't care whether someone visits via .com or .co.uk, but I want to capture combined analytics for both. My questions is, with the way I've set things up using GTM, will GA save data for both domains ie mysite.com and mysite.co.uk, or do I need to set things up another way to achieve this? Ideally, I don't want to go down the forwarding route i.e. forward all traffic from .com to .co.uk.
First a bit of pedantry: Google Tag Manager cannot even collect informatiom from a single domain (it's not a tracking tool). And while you can only enter one domain in Google Analytics that domain setting serves no actual purpose; a Google Analytics account can track multiple domains in different "properties" (porperties are sections in an account that each have a unique id) or in a single property via cross domain tracking. Cross Domain tracking is used if you want to treat multiple domains as a single presence on the web (i.e. if you have a website and a shop with different domains, they still belong together).
Now, the way you have set things up data will be collected from both domains. There are at least two caveats:
1) If users can switch between domains inside a session (go from .com to .co.uk and back) their sessions will be interrupted and Google Analytics will register multiple visitors (that's because users are tracked via cookies which are domain specific). To avoid that you'd need to set up cross domain tracking (and how you would do that depends on if you are using Universal Analytics or asynchronous code. Look at your tracking code, if it contains a line that starts "ga("send"...." your are using analytics. If it contains lines that start with _gaq.push you use asynchronous code).
Cross domain tracking documentation for UNiversal Analytics (analytics.js)
Cross domain tracking for asynchronous code (ga.js)
2) By default Google Analytics tracks only the path, not the domain. If pages on both domains have the same path they will be displayed in aggregated form in the reports, that is if you have an index.php on both pages the visits for both will be added up. Maybe that's just fine with you, if they show the same content in any case. Else you'd either have to use "hostname" as a second dimension (which is not a sticky setting, you would need to re-apply that every time you switch to another report), or you create a filter on your view that includes the hostname in the reports.
Those caveats are relevant because data will show up in any case and will look perfectly okay even if it's not (even if you decide that those two things do not bother you you need to take them into account when you interpret the data).

Resources