Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
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
-
How to exclude traffic for a specific mobile device in Google Analytics view?
Hi, Need help on how to exclude traffic for a specific mobile device in Google Analytics view. I have been searching and the only information available is excluding IP address of internal traffic. Is there any way to exclude traffic through a mobile MAC address?
Reporting & Analytics | | Khadija_K0 -
Would updating Meta Titles affect Google analytics tracking?
Hi All, I need a little bit of help. We need to optimize our blog's articles Meta titles for SEO which all exceed 100 characters. I was told that if we change the titles, google analytics would split the tracking pages and count the data as 2 pages (old title and new title). Has any of you have this experience before and if so, is there a way to avoid google analytics counting this as two pages? Thanks in advance! Viviana http://analyteguru.com/ http://analyteguru.com/ http://analyteguru.com/
Reporting & Analytics | | mchoi0 -
No-indexed pages are still showing up as landing pages in Google Analytics
Hello, My website is a local job board. I de-indexed all of the job listing pages on my site (anything that starts with http://www.localwisejobs.com/job/). When I search site:localwisejobs.com/job/, nothing shows up. So I think that means the pages are not being indexed. When I look in Google Analytics at Acquisition > Search Engine Optimization > Landing Pages, none of the job listing pages show up. But when I look at Acquisition > Channels > Organic and then click Landing Page as the primary dimension, the /job pages show up in there. Why am I seeing this discrepency in Organic Landing pages? And why would the /job pages be showing up as landing pages even though they aren't indexed?
Reporting & Analytics | | mztobias0 -
Why google stubbornly keeps indexing my http urls instead of the https ones?
I moved everything to https in November, but there are plenty of pages which are still indexed by google as http instead of https, and I am wondering why. Example: http://www.gomme-auto.it/pneumatici/barum correctly redirect permanently to https://www.gomme-auto.it/pneumatici/barum Nevertheless if you search for pneumatici barum: https://www.google.it/search?q=pneumatici+barum&oq=pneumatici+barum The third organic result listed is still http. Since we moved to https google crawler visited that page tens of time, last one two days ago. But doesn't seems to care to update the protocol in google index. Anyone knows why? My concern is when I use API like semrush and ahrefs I have to do it twice to try both http and https, for a total of around 65k urls I waste a lot of my quota.
Reporting & Analytics | | max.favilli0 -
Google Analytics - Keywords (not set) or ( not provided) WHY???
In Analytics, most of my visitors are landing on my home page, but when trying to see wich keywords they use, most of them are: (not set) or ( not provided) See screencast: http://screencast.com/t/AKwPW76qLVsN Can you tell why? What is going on? Is there a way to solve this? Thank you, BigBlaze
Reporting & Analytics | | BigBlaze2050 -
How do I manually add transactions to Google Analytics
We are seeing Google Analytic's drop transaction on our site so therefore all the figures are skewed. Is there a way I can manually add transactions to GA to cover the missing one?
Reporting & Analytics | | Towelsrus0 -
Localhost:4444 Showing Up in Google Analytics
Hello All, Lately in my Google Analytics account I have noticed a referral source labelled: localhost:4444 The number of visits is really high from this source, but I have no idea (no clue!) what it actually means. Can anyone shed some light on what this is about? Should I be creating some sort of filter to screen out this as a referral source (assuming it is not legitimate)? Many thanks in advance. Cheers!
Reporting & Analytics | | Robert-B0 -
AW Stats vs Google Analytics
Hey Moz Community, I am looking to get opinions on the best practice for analytics/traffic analysis. From experience I know that AW Stats reads high and Google Analytics reads low for traffic for reason in this article http://www.smartz.com/blog/2009/01/23/analytic-confusion-%E2%80%93-awstats-vs-google-analytics/ It drives me a little nuts how far off both are for some pages. I have one article that shows 100 views (GA) and AW stats shows 5 times that number of views. Any suggestions or systems you recommend? Thanks
Reporting & Analytics | | johnshearer0