One web + One GTM but different Google Analytics - google-analytics

I have a web with different countries (languages) in different paths like
domain.tld/en-en/
domain.tld/za-en/
domain.tld/de-de/
...
They all have the same page structure, so I would like to use the same GTM for all of them. But I would like to track those pages in different Google Analytic Accounts for better overview. Is this possible in GTM, or is there a way in Google Analytics to split everything by this path-structure?
Otherwise, my workaround would be to copy the GTM-Container X-Times, which would be not good for maintenance.

Related

Separate Google Analytics data based on dev environment

So I've found a few similar questions, but often either outdated, not exactly what I'm searching for or they don't use Google Tag Manager but write their tags in the <head>.
----------- Current situation -----------
We use Google Tag Manager to inject tags such as Google Analytics on our website. We use multiple tags depending on what needs to happen; such as:
tracking pages
tracking specific clicks
tracking log in or registration events
All the data goes perfectly to Google Analytics
----------- The problem -----------
However, we also receive data from other environments such as localhost:3000 or https://dev.ourdomain.com, which can result in inaccurate data.
----------- What we want -----------
Is a way to separate that data. By either:
Separating Google Analytics in data from production (domain A) and data from development (other domains)
Separate the data before it reaches Google Analytics (like my suggestion below)
Or maybe other suggestions
Between point 1 and 2, I'm more of a fan of the first way, as this would separate existing data into production and development data.
----------- Suggested solution -----------
I've been thinking about using a new property and then, using Google Tag Manager, I would return Google Analytics Settings depending on the current domain. Production would return UA-code-1 and development UA-code-2. The only issue however, is that every Google Analytics tag in GTM must be duplicated. With one containing the Google Analytics Settings for production, the other for development.
I was hoping there was a better way to tackle this, any suggestions?
You can still use single Google Analytics settings variable in your GTM and have a single instance of each tag but you can use some Lookup Table / custom JS variable inside your GA settings variable in place of tracking ID.
I assume you're using GA4, and if not, that would be a good idea since Google is really pushing the move from UA to GA4. You can create multiple properties for each domain, which would each have their own tracking ID. Then, in your index.html file where the installation code is, use some JS code to switch the tracking ID based on environment.
You'll also need separate Google Tag Manager containers for each property. If they all share the same container, you'll see the inaccurate data start to flood your properties.
This takes a bit of work, but will save you the hassle of inaccurate data being tracked in your respective properties.

View Google Analytics Data of Multiple Sites?

On the Google Analytics account I use, we collect analytics for multiple websites. We can see users and sessions for each website, that's great.
So far, every feature of Analytics I've come across only allows me to view information from just one site at a time, but now I'd like to see multiple sites.
What we are looking for, is a way to simultaneously view the number of users and sessions of all the websites under our account. I have google searched the problem, I've messed with every single setting I can think of. No progress.
How can we do this?
You could use Data Studio for this. You can either have separate tables on one page for all of the sites you want to report, or to make it more seamless, make a data blend to get stats from multiple sites with multiple GA accounts into one table
It is impossible to create a single view for different trackers in GA.
But you can download data from different trackers to one scheduled report in Google Spreadsheets using Google Analytics Spreadsheet Add-on https://developers.google.com/analytics/solutions/google-analytics-spreadsheet-add-on
Or create one new tracker and implement on all your websites.
You need to set up cross-domain measurement.
Cross-domain measurement makes it possible for Analytics to see sessions on two related sites as a single session. This is sometimes called site linking.
https://support.google.com/analytics/answer/1034342?hl=en

Google Tag Manager + Google Analytics v just using GA: any reason to use just GA?

I am using Google Tag Manager on all my sites now to implement Google Analytics and future proof them for any other scripts.
I am putting GTM in my boilerplate.
Is there any reason this might not be good practice?
Any reason why a website (that needs GA) should avoid Google Tag Manager?
Most websites will require some sort of Javascript code added in the future for affiliate tracking, various analytics and having GTM installed will allow for easy installation of any such JS code easily.
Or, as Google puts it: "Why wait months for site code updates? Google Tag Manager lets you launch new tags any time with a few clicks, so you never miss a measurement or marketing opportunity."
Since GTM does not come with a service level agreement you could (very very tenuously) argue that GTM adds an additional point of failure. And if one wanted to be pedantic one could point out that not all ways of analytics tracking work with GTM (if you track serverside via the measurement protocol).
But real life argument, there is none (IMO).
There might be pages that do not greatly profit from GTM (or any other Tag Management) if all you do is to deploy a single analytics tag to track pageviews. But the second you need to track an event or pass data GTM is already worth it.
This is not meant to be merely opinion based, it's more that in 2,5 years of using GTM on large sites I have been unable to find any scenario where the tag management code has caused any technical problem or interfered with existing code. On the other hand I do not write click handlers or submit handlers anymore, I have a boilerplate template for a container tag in which I just have to replace values for a few macros before I import it to GTM and have tracking up and running, I can set data fields with much less trouble than via the code... so I think there is a real technical argument to make in favour of GTM, and none against it.

Fake a subdomain in google analytics

I am currently working on a web app that will be running in an iframe on the webpages of our customers. Now i would like to setup google analytics tracking in a way that i that i can easily distinguish one customer from the other. My plan is to "fake" subdomains, even though it is always the same TLD, so that i can setup a profile for each customer, but still have overall analytics as well.
For example my URL is http://www.domain.com/#/3 where 3 is the customer id. Now i would like to see that in google analytics as 3.domain.com.
Is that possible by doing something like this:
ga('create', 'UA-XXXXXX-1', 'domain.com');
ga('set', 'location', 'http://id.domain.com');
or do i have to go about this in another way? My google analytics knowledge is limited to reading the stats and tracking events and pageviews, so maybe there is a whole different and better way to do this - i am open for suggestions.
Thanks!
It will be much better to use custom variables for this purpose. They give you additional segmentation possibilities on any values and metrics you need, such as customer names or IDs (or both ...)

Targeting Sources With Google Analytics Experiments

I am curious if Google Analytics Content Experiments supports targeting based on the traffic source, in particular, certain Google Adwords campaigns.
For example, I have two Adwords campaigns pointed to the same destination url but would like a Content Experiment to only run for one of these two campaigns.
Even targeting the experiment based on the referring url would be helpful but I don't see an option to do so when setting up the experiment. Does anyone know if this is possible through the set up, or if I would need to create some kind of gateway that my campaigns funnel through and then get routed to the experiment URL based on the source?
Thanks!
Google does not currently provide this function by default.
I'd try https://www.optimizely.com/ (easier) and/or patching up custom bucketing code (more difficult)

Resources