Is Analytics Code for SubDomains different?
-
I am currently tracking site performance on our website with Google Analytics.
Recently, we've brought a Wordpress blog into our site as a subdomain blog.accupos.com. Though we did this a few months ago, we do not have Analytics data for these pages within the wordpress platform.
I've found where to paste the code, in the Footer block of the Wordpress template, just before the close body tag (is this the best recommended way?) and just have one question about WHICH code to paste.
Can I add the original code, same as the rest of the site? Or does Analytics have a different code for tracking subdomains? If so, do I need to replace existing code for the rest of the site?
I hope I worded this okay. Please help. I'd appreciate it!
Derek M.
-
Hi Derek
I checked out the site real quick.
Technically 'www' is a subdomain. So you should have www.accupos.com and blog.accupos (or just accupos.com for the main site).
When Google Analytics says "mutiple subdomains" they mean a website that has a root domain (accupos.com) with more than one subdomain it can load with - in your case it should be blog and www - but somehow you've got what's called a "sub subdomain"
So you should first look into how/why its set up like this and just have blog.accupos.com (without the www) This is something you'd have to likely work with IT or your developer to fix.
Then in analytics you'd select "One domain with mutiple subdomains" and you'd be all set.
-Dan
-
I did see that tool for Analytics code but not sure how it fits together with the following:
When I found the Code Snippet in Google Analytics, there were 2 options, one was for "A single domain" and another variation of the code was for "One domain with multiple subdomains".
So here are my 2 Questions:
Considering our blog is in the subdomain format, www.blog.accupos.com, is this second code more appropriate, especially since we DON'T have MULTIPLE subdomains? (we only have one...www.blog.accupos.com)
If we do use the NEW code for "multiple subdomains", do we also replace the Analytics snippet on all the OTHER pages within the site which are already being tracked with the old code...?
Thanks!
DM
-
Hi Derek
You can use the same analytics code as you do for the rest of the site. It makes sense in this case.
I would recommend using Yoast's Google Analytics plugin for WordPress - this way you don't need to put the tracking code into the WordPress code, the plugin will do it correctly for you.
Hope this helps!
-Dan
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
-
ECommerce Tracking in Analytics - Should I use a plugin or do it manually?
Hi, I have a WordPress site (woocommerce integrated). I would like to know should I use a plugin to enable e-commerce tracking in Google Analytics or I should do it manually with GTM. Which is a better way? Will using a plugin to enable e-commerce tracking slow down my site? Any thoughts? Thanks in advance.
Reporting & Analytics | | Mr.Suren0 -
Attribution of conversions to payment gateway in Google Analytics
Hi all, We have been having a problem for a while now where most transactions are attributed to referrals from our payment gateway Sagepay. The issue started a couple of months ago, when we finally upgraded our website to https:// for logged in users and transactions. Before, when we were using http://, transactions were attributed to the correct channel. Even weirder, we upgraded 4 websites and only 2 of them have the issue now, the other two continue to attribute transactions correctly. I added Sagepay to the referral exclusion list which made no difference. Over the weekend, we upgraded to the global site tag and it seems to have improved somewhat, but yesterday 50% of transactions were still attributed to referral/sagepay. I am also seeing an odd issue, where for half of the transactions, the revenue and transaction are attributed to one channel, but the products (quantity) are attributed to another. One of the channels is always referral/sagepay and the other is the channel that the transaction should be attributed to. Has anyone seen this issue before? I'd appreciate any tips that might help us fix this issue. Thanks in advance!
Reporting & Analytics | | ViviCa10 -
Amazon referral on analytics
In the past month, I've received referrals from tt.amazon.com, coming from both Ireland and Germany - it made me a bit suspicious as I haven't seen tt.amazon before and I can't find much online about it. I'm a little reluctant to click through to the website in case it is suspicious... Does anyone know anything about this and should I be concerned? Thanks!
Reporting & Analytics | | RayflexGroup0 -
Regular Expressions in Google Analytics
Hi All I've been struggling to create a regular expression for a Google Analytics goal step that would match the following: ^/specifictextstring/anytextstring/anytextstring/
Reporting & Analytics | | Cabbagefeet
^/specifictextstring/anytextstring/ However I don't want it to match any URLs that end with: /anytextstring**_**phonecall or /phonecall, for example: /specifictextstring/anytextstring/anytextstring/anytextstring**phonecall
/specifictextstring/anytextstring/anytextstring**phonecall
/specifictextstring/anytextstring/anytextstring/phonecall
/specifictextstring/anytextstring/phonecall Does anyone have any ideas? Thanks in advance for all contributions.0 -
Google analytics for mobile apps - do we need different id's?
Dear all, if I want to implement Google Analytics for my mobile apps: Do I need different accounts or id's to ensure separate tracking of my website and mobile apps? How did you do it? Thanks!
Reporting & Analytics | | HMK-NL0 -
Google Search Results inconsistent from different computers
Recently after some optimization activities - I do not see much movement in search rankings - my client is seeing the results on page 1 position 3 and I see page 2 for the same keyword. How does Google change ranking based on past searches and how can I get an accurate picture of what the actual rank is?
Reporting & Analytics | | devonkrusich0 -
Google Analytics - multiple counters
Hey there Mozzers! One of our customers wants to seperate one Google Analytics account into multiple accounts. The website is divided in three parts: Main: www.website.nl Sub1: www.website.nl/sub1 Sub2: http://www.website.nl/sub2 And they would like 4 different reports under one account. R1: Total count R2: Website.nl (without Sub 1 & Sub2) R3: Sub1 R4: Sub2 I know multiple counters will get in conflict with each other, so I have to implement some filters. E.g: We can configure a filter for R3 on "astmakids" in URL. My question is: is there a safe way to implement multiple Analytics filters on one website? And how will R3 see visitors that come from the root domain astmafonds.nl? Are they referrals? Thanks a lot in advance!! Partouter
Reporting & Analytics | | Partouter0 -
Analytics giving crazy impossible data?
When I look at my Analytics using any of my segments, they don't work. It shows zero visits for the segment until April 30th, then the visitors for the segment shoots up to above the number for all visits! Anyone else experiencing this bizarre data?
Reporting & Analytics | | mascotmike0