Setting up Google Analytics default URL
-
If someone has set:
-
the default url in Google Analytics to a non-www address (http://mysite.com)
-
then placed the UA tracking script from that GA account within the CMS framework of the website...
-
... and then set the permanent 301 redirect in the htaccess file to redirect to the www address (http://www.mysite.com).
How less accurrate will my GA analytics measurements be considering the default url within GA is non-www and the permanent 301 redirect in htacess is to the www-address?
Anyone know how reliable GA reports are until the default url in GA analytics is changed to match what is the redirected url in htaccess file?
_Cindy
-
-
Got it, very helpful - thanks so much!
_Cindy
-
Hostname injection is when you add the hostname value to the beginning of the content URI. Instead of seeing just '/index.html' in the content URI reports, you would see 'www.mysite.com/index.html'. This is helpful when you are tracking across multiple subdomains and you need to tell the difference between files on your different subdomains. You would see the following, as an example:
www.mysite.com/index.html
blog.mysite.com/index.html
store.mysite.com/index.html3 different pages on different subdomains. Without adding the hostname, they would have rolled up into a single '/index.html' line and it would be difficult to know which subdomains they are from.
More info on setting up the filter can be found here:
-
OK, thank you.
If I understand correctly, the tracking code for a single site did the work of tracking visitors, and the 301 redirect didn't change the tracking results -- even though the "301 redirected address" was at one time different from the "GA default url."
If I may ask, what is a hostname injection? And if possible please explain a use case example where hostname injection is used.
_Cindy
-
The 'Default URL' field in a Property Settings screen will do a few different things:
- Prefill a setDomainName value for your tracking code if you select tracking for multiple subdomains or domains. I'm just noting in here, since none of what you described would be a cookie domain issue.
- The Default URL would be would be prepended to the content URI when you are viewing content reports and click the icon to view the page in a new window.
What I'll emphasize is that your Default URL value will have no effect on your data collection. It's simply not used in any data processing. There are many use cases for having an empty Default URL, for example, if you are doing a hostname injection into your content URIs and you don't need another hostname prepended when you attempt to open a content URI in a new window, like I described in the 2nd option.
Hope this helps.
-
Everything is consistent now - 301 redirect to www, default url in GA set to www.
Tracking code has remained the same within cms because the GA account's url was changed to go to www.
It is a matter of too many chefs in kitchen and no one had control of entire picture at one point.
My question really is... when there was inconsistency in web address from 301 redirect (www-address) and the GA default url (non-www), why was GA still receiving traffic?
And how much can one rely on older metrics when this inconsistency was in place?
_Cindy
-
Hi Cindy -
Why would you set the default URL to non-www, and then set GA to track the WWW address? I think you should send all your traffic and tracking to one or the other. That's the first step in cleaning this up.
I would suggest mapping everything to the www version as you have this set in for your 301. Sooner than later would be best to get accurate tracking started.
oh - and fix the tracking code - to include the WWW version and not the non-www. That also needs fixing.
Cheers, Rob
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
-
Google Analytics, Wordpress, Sumo - who to trust
Something is wrong. I have a website that according to Google Analytics gets zero relevant clicks, with most of the clicks it does get coming from Russia. Wordpress says it gets a hundred or so visitors a month, with most traffic going to the pages that I know rank. Sumo says the heat map got 76 clicks. How would you figure out what's really going on?
Reporting & Analytics | | julie-getonthemap0 -
How do you analyze a traffic drop with no historic Google Analytics data?
A client of mine has a large website with multiple sections (shop, forums, articles, etc.) that apparently had a significant reduction in rankings, traffic, and sales in the past. However, historic Google Analytics data is not available for the site, and I'm having troubles identifying anything concrete about the traffic drop, such as when it happened, what pages/sections it happened to, etc. The shop traffic drives most of the revenue, but it's a small number compared to the forums traffic, so it's hard to pick anything out of top-line trends like SEMrush offers. What tools or strategies might help in this situation?
Reporting & Analytics | | AdamThompson0 -
Google Analytics global page empty
Hello, I don't know what happened with my Google Analytics initial page. For around a week I have there all my websites, but they show no results on global page. If I enter on any property I can see everything as normal, just not on the initial page. Screenshot: http://imgur.com/JKFVIh4 For sure I changed anything that I shouldn't. Perhaps you know what's wrong? Thank you in advance.
Reporting & Analytics | | prozis0 -
Google Tag Manager chrome plugin to diagnose Analytics issues
Hi I've just used Google Tag Manager chrome plugin to look at possible analytics issues on a clients site and it has reported that its Analytics ID is being tracked twice. 1 is Universal and the other is Universal Asynchronous And when i click the question mark next to the 'Where to Optimise' info in GTM this page is displayed with teh following info highlighted: https://developers.google.com/analytics/devguides/collection/gajs/asyncMigrationExamples ga.js is a legacy library. If you are starting a new implementation we recommend you use the latest version of this library, analytics.js. For exisiting implementations, learn how to migrate from ga.js to analytics.js. Since both versions seem to be on there surely i dont need to migrate but just delete the old non-asynchronous version ? Or do i need do anything else or additional ? All Best Dan
Reporting & Analytics | | Dan-Lawrence0 -
Google Analytics Real Time Not Working! :(
Hello Everyone, Today, the real time feature in my google analytics stopped working. I am able to see that traffic is visiting my site, but not in real time. The real time count is usually at 0. But, there are some instances where real time will come back online, but there will be only 1 unique visitor. At any given time, our website usually has 20 visitors or so..Has anyone encountered this issue? Where should i start looking for fixes? What are the possible problems? Thanks!
Reporting & Analytics | | KarlMarxTheBear0 -
If I install google Analytics, that can affect my SEO.?
I purchased a site that has a lot of Backlinks and when I started to make changes like installing google analytics! i suspect the performance in search engine was getting worst because of that, so I removed.
Reporting & Analytics | | pparma
Now I'm trying MOZ and needs GA, should I install it again??
Maybe it analyces the backlinks and tells google, I don't know, is that possible?0 -
Google Analytics Custom Filter
Hello, Quick question, when I create a custom filter on a profile that already has data collected will that filter apply to already collected data or will the filter only apply from the day it was created? Am doing a custom exclude IP filter. Much thanks,
Reporting & Analytics | | Unity
Davinia0 -
What is s.ytimg.com in google analytics?
My clients GA reports 273 visits from s.ytimg.com. I go to the site, it doesn't exist. I googled it, there were some code with s.ytimg.com in it, but nothing I could understand. Anybody have an idea where this comes from?
Reporting & Analytics | | endlessrange0