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
-
Webmaster Tools equivalent to Change Default Address found in Analytics
Hello all! We're changing from http to https. In Google Analytics there is an option to change the default address so we keep our historical data. I can't find a similar option in Webmaster Tools though. Do you have to setup a new property or is there an option to change your current one? Thanks in advance!
Reporting & Analytics | | thegrbteam0 -
In google analytic for google /cpc it is showing url with 404 which even not exists in my database
Hello All, In google analytic for google /cpc it is showing url with 404 which even not exists in my database that also more than 300 per day. How can it is possible? it is showing /black-friday-offers but I don't have such page. Thanks!
Reporting & Analytics | | pragnesh96390 -
Goal Totals in Google Analytics
How do I get a cumulative tally of all the goals reached in google analytics? I've been using the percentages currently, but I was wondering if there was an easier way. Thanks
Reporting & Analytics | | OOMDODigital0 -
How to not track mobile redirects in Google Analytics
If a user is on a mobile device and comes to our home page, http://www.darden.virginia.edu/web/Home/ they are redirected to http://m.darden.virginia.edu/web/Home/. We want a way to remove all the redirects from our Google analytics reports. More specifically we do not want to include the the page view of http://www.darden.virginia.edu/web/Home/ in our page view count when the user is on a mobile device. How do we do that?
Reporting & Analytics | | Darden0 -
Excluding referral traffic from a specific page Google analytics
Hi, I am trying to exclude from referrals from a particular page i.e. www.domain.com/nothispage within Google analytics, I have tried a couple variations within the advanced filter (Regex etc) section without much luck, could anyone assist ? Updated-trying to do this using a filter for the entire profile. Thanks Marc
Reporting & Analytics | | NRMA0 -
301 Tracking with Google Analytics hurts SEO?
Hey guys, I have an old-domain.com and a new-domain.com. old-domain.com has reputation and through a 301 redirect it's handling it over to new-domain.com. I want to know how many people still visit old-domain.com and track this with Google Analyitcs. I read the best solution for this would be a Google Campaign URL. My question: Does a URL like "http://www.new-domain.com /?utm_source=&utm_medium=redirect&utm_campaign=" hurt the effectiveness of the 301 redirect?
Reporting & Analytics | | optimiert-es0 -
Comparing % Change, Google Analytics
Hey Mozzers, Is there a simple way to compare the "% Change" in traffic when comparing two separate time periods in a single Google Analytics report? When comparing data from two separate time periods, an exported CSV doesn't include the % Change (booo!), and there's no option to sort by % Change within the GA report, essentially forcing you to scroll through all the results to pinpoint the major movers and shakers. I'm not averse to using spreadsheets to sort this data, but I'm thinking that I'd likely need a macro to make this work, something like this. However, none of the macros on that page are working (possibly because they were designed for a previous version of Analytics). All suggestions are appreciated. Thanks!
Reporting & Analytics | | dangaul0 -
Get Stats on Search Box Usage, Using Google Analytics?
Let me preface this by first saying I am NOT using the Google Adsense Search feature. The question I am asking is pertaining to the standard search box that comes already coded in most .php blogs. In the Google Analytics, is there a way to tell how many people are searching using the search box? I've looked through the navigation and pathway options in analytics and I don't seem to see anything that definitively points to the number of people using the search box but, perhaps, I am overlooking it. Any insight?
Reporting & Analytics | | ChristineCadena0