Google Analytics cross domain doesnt work - google-analytics

I have 2 properties, where each of them sits on a different domain.
The analytics work as needed per page view, but cross-domain analytics won't work. when looking at the cookies looks like the client id passes between the Properties
Using gtag and Followed this article,
https://developers.google.com/analytics/devguides/collection/gtagjs/cross-domain
When using Google Tag Assistant it seems that the source site sends tags as needed but the destination doesnt

To get cross-domain tracking the hits must be sent to the same Property.

Related

How to create a Google Analytics report on a specific query string?

I have hunted around a bit and only found how to setup the site search parameter in a site's admin section. This is not what I want. Also looked through some Google Search Console videos - no go.
Given a URL, https://somesite.com/redirect/?redirect=https://gofundme.com/somecampaign/.
As some background, what I have setup here is a simple page that says "Loading..." and is used for external links I want to track analytics on, from platforms that I may not have access to the link's analytics. For example: https://gofundme.com/somecampaign.
Rather than having a redirect setup on the page itself, I injected custom JavaScript through Google Tag Manager that records analytics data in Google Universal Analytics (anyone want to recommend how to do this in G4A?) then performs the redirect.
My question is, in Google Analytics, how do I setup a custom report where the query string parameter = redirect and/or the specific page URL?
Thanks.

How to set up cross-domain tracking in GA4?

How to set up cross-domain tracking in GA4 right?
I followed official instructions: [GA4] Set up cross-domain measurement
I've added all the domains I need to the Date Stream Details - More Tagging Settings - Configure your Domains.
Added 'Google Analytics: GA4 Configuration' tag on the website using Google Tag Manager.
But now, when switching between domains, a lengthy parameter
(smth like "?_gl=11lop9ld*_gaNDcxNTp2McYzKjE2LTcxMjQwKLv._ga_3JP1WO1NB3MTYxNzEyNDA4Ny8xLjEuKOPxNzEyNLI5Ny40Nw..")
is added to the page address and the page does not open, a 404 error appears.
What could be the problem?
As #Tony McCreath said, It might be a problem on the website's end on handling unexpected query parameters. I already faced this problem while working on a client website, and there was nothing that could be done on the Analytics side to fix the issue. You can test if that's the case by adding any random parameters at the end of the URL to see if the website still works.
The lengthy parameter that is added to the URL is the way Google uses to identify that a user is coming from another domain. It's basically an ID that will link the user from the previous domain to the current one.

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.

Force SSL on Google Analytics analytics.js load via Google Tag Manager

We load Google Analytics (Universal) via Google Tag Manager and I can't find any way to force it to load the analytics.js script itself over SSL; we set forceSSL via the fields to set options, but by the time it applies that it has already loaded the initial script over plain HTTP.
It looks like GTM checks whether it's on an HTTPS URL and then loads GA over HTTP if so, but I'd prefer to force it over HTTPS instead. Is there any way to do this?
Unfortunately, looking at the documentation available at the very bottom paragraph of Google Tag Manager - Dev Guide - Security, it reads:
While most of the tag templates in Google Tag Manager are also
protocol relative, it's important to make sure that, when setting up
custom tags to fire on secure pages, those tags are also either
protocol relative or secure.
I flipped through a GTM profile to see if there were any configuration options exposed, but I didn't see any either. To your statement about using forceSSL, that wouldn't do anything (as you found) because it's setting a configuration in the already-loaded GA script to use for sending the future requests (e.g. pageview and events).
So, I loaded up a page with GTM installed on it with GA and took a look through the logic until I found where Google Analytics is loaded up from. If you'll take a look, we've got a function that's essentially determining whether to load GA up from either HTTP or HTTPS depending on the value of location.protocol as in the below screenshot:
That means that unless you load up the GA tag via a Custom HTML tag, you're not going to be able to change it to explicitly only load from HTTPS. You mention you're considering just hosting GA directly on the page - you're going to be pasting the exact same snippet there as you would in this Custom HTML tag (ensure that it's surrounded by tags or it won't do anything), and if you're already using GTM for something else, there's little reason to leave your vendor logic in multiple places.
So, in a long answer, no, you can't specify that you want to only load Google Analytics via SSL without resorting to using a Custom HTML tag (and then you unfortunately lose a lot of the mapping simplicity of using the GA tag itself).

Google Tag Manager + Analytics doesn't seem to be working

I recently set up Tag Manager and Google Analytics.
In Google Analytics
I set up an account
In Tag Manager
I pasted the Tag Manager script just under the body tag of all my pages
I set up a container
I added the "Universal Analytics" tag
I copied my Google Analytics tracking ID "UA-...." to the tag
I added the "All pages" rule to the tag
I published the tag
When I hit one of my web pages, I see
- a call to googletagmanager.com/gtm.js?id=GTM-... (with my tag ID)
- a call to google-analytics.com/analytics.js
- a call to google-analytics.com/collect?...tid=UI-...&tgm=GTM-... (with both my tag and analytics ID)
Now when I go to the Google Analytics dashboard, I see no sessions, not even in the Real-Time session dashboard.
Under Admin > Property > Tracking Info > Tracking Code, it says "Status: Tracking Not Installed" I assume this is ok since I didn't copy the Analytics script to my page, but the Tag Manager script instead.
Is there some delay, or am I setting it up wrong?
I recommend every time you sent up GTM with a analytics tracking tag that you check that it sends data. This can be done by looking at the developer tools with chrome or firefox. Really any web browser.
In your web browser open up developer tools and open network. Find the filter button a and search for "UA-".
If you see something that says pageview, scroll down the headers and you will see your UA Account number and if you used GTM to implement the tag you should see your GTM tag ID.
Reload the page and check again. If you see it means it is sending data to the correct property. If it is not then there is something wrong with your implementation.
If you set everything up correctly and still dont see data check your filters. I always recommend keeping one view unfiltered.

Resources