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
-
What would be causing our linking domains and inbound links to decline?
I am noticing a decline in the number of our linking domains and inbound links from month to month. It isn't drastic but looking like a trend. Any reason why this would happen? I'm not sure where to start. Thanks!
Reporting & Analytics | | amanda_feagle0 -
What determines the page order of site:domain?
Whenever I use site:domain.com to check what's index, it's pretty much always in the same order. I gather from this, the order is not random. I'm also reasonably certainly it isn't related to any page strength signals or ranking results. So, does anyone know why the pages are displayed in the order they are? What information does the order of the pages tell me? Thanks, Ruben
Reporting & Analytics | | KempRugeLawGroup1 -
Strange Behaviour - Varying rankings across browsers and devices
Hello, I noticed something quite strange over the last week with one of my keywords. I'll explain the lead up to this so it makes more sense. I started SEO work for a client about 3 months ago. One of the keywords I'm trying to increase their ranking for is "auto body calgary". I made a specific landing page for this keyword so it could be better targeted. After I made this landing page I saw their root domain (not the landing page) increase about 10 rankings to number 9 in 2 months. It hung at number 9 for about a month, and then the last month it has decreased to rank 15. For interest sake I searched "auto body calgary" on multiple computers and browsers. On one of the computers I used Safari and my landing page showed up in the number 2 position. On my mobile phone and personal laptop I used Safari and it showed to root domain ranked at 15. I used Google to search every time and wasn't logged in to my Google account on either of the searches. The only thing I've done in the last month is updated some of their directory submissions so they are more consistent. Out of this I have two questions: Why would different browsers show considerably different rankings and pages for a keyword? Since my landing page is more targeted to "auto body calgary" is Google trying to show that page instead of the root domain? (my root domain has considerably more authority than this landing page) Thanks to anyone who can offer insight!
Reporting & Analytics | | reidsteven750 -
Using advance segments or primary dimensions?
Hi guys, I haven't played around with advance segments enough to know the answer to this, so looking for some help. What I want to track is a keyword through the whole analytics, so I created an advance segment for "KEYWORD". This segment is Include - Keyword - "KEYWORD". Now when I remove the advance segment and do the following: Traffic Sources - Organic - Primary Dimension - Keyword - "KEYWORD" The amounts of visits differ a lot. I'm guessing this has to do with sessions? Looking for a clarification on this.
Reporting & Analytics | | William.Lau0 -
GA profile when migration domains
I'm migrating a .co.uk domain to .com and am trying to decide if I should reuse the same Google Profile (if I can?) or create a new one. If I choose to reuse the same profile so it has historical data, does anyone know if it's just a matter of keeping the same UA profile identifier in place on the page? Or do I have to change anything on the actual profile in GA as well to say "start pulling data from .com now"?
Reporting & Analytics | | Lindsay_D0 -
Google as referring domain
Hi all, a colleague asked a question, which I could not answer (never even noticed this "problem") 😞 When we are logged into our GA account and go the referring domains section, we find Google. I always thought that these visitors came via Google Image Search, but not all of them do. Most of them come via "/imgres", but some come via "/" (always thought that "/" was the homepage?), "/url" and "//" Maybe I am just stupid, but honestly I could not explain what these strings mean... or how these visitors landed on our site... Can you help me???
Reporting & Analytics | | accessKellyOCG0 -
My GA code is on my site but Google Analytics isn't being pulled into SEOMoz...why?
The CEO wants me to present an SEO plan next week for three of our sites; however, I got this message when I went to campaign overview tab: "It appears there's a problem with our connection to your Google Analytics account. Please go to your Settings page to update your connection." I double-checked the GA code and it's the same on both our site and in SEOMoz...what gives? I clicked on Choose Your GA Profile->Set GA Account and Profile then got this warning: "Are you sure you want to change your Google Analytics connection? Changing your connection will reset our cache of your historical GA traffic data." I need this data pronto so I can set strategy for three sites; any help would be greatly appreciated! Darrell
Reporting & Analytics | | AdviceElle0 -
Cross domain tracking setup in Google Analytics
I really need help on this, I can't figure it out. I need to track a few subdomains and and couple of seperate domains in one profile in Google Analytics. So I have: www.maindomain.co.uk sub1.maindomain.co.uk sub2.maindomain.co.uk www.anotherdomain.co.uk So the code I have placed on all of these domains is as following: I have then set up seperate profiles which filter out the data by domain. E.g. for sub1.maindomain.co.uk, I have user the fitler: Custom filter > Include > Filter Field = Hostname > Filter Pattern = sub1.maindomain.co.uk For the www.anotherdomain.co.uk, I have used the same filter. Now this all seems to be tracking visits and unique visitors okay, but I always have a very low pageview count, less than visits and sometimes zero. Could anyone shed any light on what I am doing wrong? Thanks in advance mozzers.
Reporting & Analytics | | MirandaP0