GA: How do I preserve custom dimension across domain and subdomain?
-
Using custom dimensions our site tracks logged-in vs not logged-in users on our shop site (shop.example.com). A user can only login on the shop.example.com.
The problem is when the logged in user visits our the main domain (example.com), we lose the custom dimension and the user becomes anonymous. At this point, if the user goes back to shop.example.com, the logged-in custom dimension comes back.
How do I preserve the logged-in user dimension across the main domain?
Example of snippet:
-
Read more about setting up a linker here in Google Analytics: https://developers.google.com/analytics/devguides/collection/analyticsjs/linker this will make sure that you can at least have cross domain tracking.
-
I'm not familiar with "linkers". How do I make sure GA is using linkers? Thanks.
-
Hi,
The logic for a custom dimension can't usually be just passed on. But what you could do is make sure that Google Analytics is using the linkers to connect the shop subdomain to the root of the site. Which will make sure that the cookies for both do overlap and then you can apply the same logic to see if the user is logged in or not.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Custom Events Not Showing in GA4
I have some experience in successfully creating custom events for GA4 via Tag Manager, but I have one account where my events are firing in GTM but not showing at all in GA4 (not real time or anywhere). I have twice done them over and published my changes but still no luck. Any ideas what else the issue can be? There are no internal filters at the moment. Thank you.
Reporting & Analytics | | bradsimonis1 -
When migrating to https should you unlink the verified http version from my GA account?
Hi We had a new site design at the end of April and at the same time changed to https. Over the last 6 months, according to our analytics account the traffic has dramatically dropped especially from mobile. We were at 3607 new visitors from mobile in April and now 32! in September. Technically (other than page speed and some meta issues that I'm aware of) there doesn't initially appear to be anything wrong. I have just been into search console and notice that the old http site still has the GA code on it, could it be that this is why the data is showing such a massive drop? Should we have taken that off when we migrated the site? The same analytics account is also on the new site. Thanks in advance Janine
Reporting & Analytics | | Janine10 -
How to filter out traffic from subdomain using regex?
Hi There, We have a test server that lives on a subdomain which we'd like to filter out in Google Analytics. We're using the hostname filter but are having trouble understanding the regex needed, we're using this as the filter pattern: .domain.com. Will that work? The profile is new so we can't test the pattern. Any pointers in the right direction would be much appreciated. Cheers Ben
Reporting & Analytics | | cmscss0 -
Cross-Domain Tracking Urgent Query :-(
Hi Mozzers! One of my clients is having an issue with cross-domain tracking, in other words their own domain is seen as a huge referrer. When you land on their site, which is www.sunway.ie, and then choose a holiday to book it then takes you to another domain which is www.sunwayholidays.ie, during the booking process. I'm just wondering if there is a Google Analytics genius out there who may be able to take a quick look and let me know if there is any obvious solution to this within the Google Analytics code? Thanks in advance everyone! Gavin
Reporting & Analytics | | strategemilabs0 -
Newsletter Campaign Need HELP to Create a Custom Report in Google Analytics
I have this newsletter send using Mailchimp. This campaign is link to G.A. How can I create custom report for me online store about this campaign? For example: I have 2 Goals Completion Location setup in G.A. they are: /checkout.php and /finishorder.php Is there a way to find out how many visitors from my campaign reach the /finishorder.php vs. /checkout.php Reason, about 50% are reaching /finishorder.php Maybe I need to creat a "How to redeem you coupon code" video to included in the newsletter to HELP customers complet there order process. Thank you, BigBlaze
Reporting & Analytics | | BigBlaze2050 -
Has anyone noticed a dramatic drop in direct visits year over year in GA across multiple sites?
I monitor about 10 websites in GA. Many of these sites are in a stable phase of their lifecycle. I've noticed this year that direct visits on all my sites and even friends sites have dropped by 20-60%. Has anyone seen any explanation for this or noticed this when compared to previous year? In every instance I have no penalties, notices, anything and the drop is made up completely of "direct visits".
Reporting & Analytics | | bradwayland0 -
Why does this domain never pass 150 organic visits from Google?
Hello, The domain http://bit.ly/fwTEsT has been out there for one year, it has about half million indexed pages. We made a lot of changes that could affect SEO and I don't know if Google likes it but the one thing it's sure is that in one whole year the organic visits from Google never got pass 150 visits per day. We've got about 2000 PPC visits but organic don't go up. I'd like to know what our main errors would be so we can focus more on fixing them. Thank you, Alexandru.
Reporting & Analytics | | elwebmaster0 -
Do I need to turn off custom results or empty my cache before using the SEOMOZ Pro Rank checker?
I'm getting unusual swings in SERPS ranks from one day to another (I had several keywords ranked in top ten go to the the third or fourth page in a week). I knwo that there's always variation because of localized and custom search, but this seems to be something more.
Reporting & Analytics | | bbelgard0