Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • Moz API Home
      • Compare SEO Products
      • Moz Data
    • Free SEO Tools
      • Domain Analysis
      • Keyword Explorer
      • Link Explorer
      • Competitive Research
      • MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO
      • SEO Learning Center
      • Moz Academy
      • SEO Q&A
      • Webinars, Whitepapers, & Guides
    • Blog
    • Why Moz
      • Agency Solutions
      • Enterprise Solutions
      • Small Business Solutions
      • Case Studies
      • The Moz Story
      • New Releases
    • Log in
    • Log out
    • Products
      • Moz Pro

        Your all-in-one suite of SEO essentials.

      • Moz Local

        Raise your local SEO visibility with complete local SEO management.

      • STAT

        SERP tracking and analytics for enterprise SEO experts.

      • Moz API

        Power your SEO with our index of over 44 trillion links.

      • Compare SEO Products

        See which Moz SEO solution best meets your business needs.

      • Moz Data

        Power your SEO strategy & AI models with custom data solutions.

      NEW Keyword Suggestions by Topic
      Moz Pro

      NEW Keyword Suggestions by Topic

      Learn more
    • Free SEO Tools
      • Domain Analysis

        Get top competitive SEO metrics like DA, top pages and more.

      • Keyword Explorer

        Find traffic-driving keywords with our 1.25 billion+ keyword index.

      • Link Explorer

        Explore over 40 trillion links for powerful backlink data.

      • Competitive Research

        Uncover valuable insights on your organic search competitors.

      • MozBar

        See top SEO metrics for free as you browse the web.

      • More Free SEO Tools

        Explore all the free SEO tools Moz has to offer.

      What is your Brand Authority?
      Moz

      What is your Brand Authority?

      Check yours now
    • Learn SEO
      • Beginner's Guide to SEO

        The #1 most popular introduction to SEO, trusted by millions.

      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

      • How-To Guides

        Step-by-step guides to search success from the authority on SEO.

      • Moz Academy

        Upskill and get certified with on-demand courses & certifications.

      • SEO Q&A

        Insights & discussions from an SEO community of 500,000+.

      Unlock flexible pricing & new endpoints
      Moz API

      Unlock flexible pricing & new endpoints

      Find your plan
    • Blog
    • Why Moz
      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

      • Enterprise Solutions

        Gain a competitive edge in the ever-changing world of search.

      • The Moz Story

        Moz was the first & remains the most trusted SEO company.

      • Case Studies

        Explore how Moz drives ROI with a proven track record of success.

      • New Releases

        Get the scoop on the latest and greatest from Moz.

      Surface actionable competitive intel
      New Feature

      Surface actionable competitive intel

      Learn More
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Moz API
      • Moz API Dashboard
      • Moz Academy
    • Avatar
      • Moz Home
      • Notifications
      • Account & Billing
      • Manage Users
      • Community Profile
      • My Q&A
      • My Videos
      • Log Out

    The Moz Q&A Forum

    • Forum
    • Questions
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. Home
    2. SEO Tactics
    3. Reporting & Analytics
    4. Setting up Google Analytics default URL

    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

    Reporting & Analytics
    3
    7
    14003
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with question management privileges can see it.
    • CeCeBar
      CeCeBar last edited by

      If someone has set:

      1. the default url in Google Analytics to a non-www address (http://mysite.com)

      2. then placed the UA tracking script from that GA account within the CMS framework of the website...

      3. ... 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

      1 Reply Last reply Reply Quote 0
      • CeCeBar
        CeCeBar @CeCeBar last edited by

        Got it, very helpful - thanks so much!

        _Cindy

        1 Reply Last reply Reply Quote 0
        • adrianvender1
          adrianvender1 @CeCeBar last edited by

          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.html

          3 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:

          https://groups.google.com/a/googleproductforums.com/forum/#!category-topic/analytics/discuss-issues-related-to-your-accounts-reports-and-data/wEoiR4kQStQ

          1 Reply Last reply Reply Quote 0
          • CeCeBar
            CeCeBar @adrianvender1 last edited by

            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

            adrianvender1 CeCeBar 2 Replies Last reply Reply Quote 0
            • adrianvender1
              adrianvender1 last edited by

              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.

              CeCeBar 1 Reply Last reply Reply Quote 1
              • CeCeBar
                CeCeBar @RobMay last edited by

                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

                1 Reply Last reply Reply Quote 0
                • RobMay
                  RobMay last edited by

                  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

                  CeCeBar 1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post

                  Got a burning SEO question?

                  Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                  Start my free trial


                  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.

                  • See all categories

                  Related Questions

                  • ahirai

                    Using logical operators (AND / OR) in Google Analytics Goal Funnels

                    When setting up a Funnel within Google Analytics, is it possible to use logical operators (e.g. OR, AND) in the first (required) step of the funnel? For example, suppose I want to track users who visit page1.html AND page2.html before proceeding to the destination goal. I've entered two pages separated by the OR operator, and neither the "Verify this Goal" nor "Save" produces an error message - is it safe to assume that this is working as I intend? Thanks in advance!

                    Reporting & Analytics | | ahirai
                    0
                  • marketingmediamanagement

                    Is there a way to find out who the admin of a Google Analytics account is?

                    We have a client who has been searching high and low to gain access to the GA account that is tied to their website, but previous agencies keep stating they don't have access. Is there a way to find out who the admins are on a GA account with the tracking number so we can reach out to that person and ask them to admin the client?

                    Reporting & Analytics | | marketingmediamanagement
                    0
                  • PeteC12

                    Google Analytics and Bounce Rates Query - Should I block access from foreign countries ?

                    Hi , When I look at my google analytics for my UK Website, I can see alot of visits come from outside the UK , i.e Brazil and USA. Both of which give me almost 100% bounce rates from people visiting from there. I am wondering, if google looks at bounce rates with regards to ranking factors and should I therefore block access to my site from visitors outside the UK ?... Would this help increase my rankings ? Given that we only serve uk customers, I cant see any benefit of allowing non uk customers the ability to see the site . what does people think ? thanks pete

                    Reporting & Analytics | | PeteC12
                    1
                  • KarlMarxTheBear

                    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 | | KarlMarxTheBear
                    0
                  • Bio-RadAbs

                    Google Analytics: Different stats for date range vs single month?

                    I've been scratching my head, chin, and you name it over this one. I have an advanced segment to remove bot traffic from my data. When I look at the Audience Overview data for a single month (let's say Aug). I am shown a session count. No problems here, however If I set the date range to (January - August). The august monthly stats is incorrect, much lower. What this means is that, if I export a CSV report from Jan-Aug, the data is wrong compared to individually recording a month. Anyone faced this? I've asked the question over at the Google Analytics technical section as well, but no answer P.S I even used the 'control the number of sessions used to calculate this report' tool but no luck.

                    Reporting & Analytics | | Bio-RadAbs
                    0
                  • EvansHunt

                    Google Analytics - Next Page Path is the Same URL?

                    Hey Everyone, I have a Google analytics question. I'm looking through a client's site and when I look at the next page path, I get the same URL as the next path. For example, on the homepage, the next page path I get is the homepage again? This happens for all URL's, is this an implementation error? Is there a way to fix this? Thanks!

                    Reporting & Analytics | | EvansHunt
                    0
                  • JMagary

                    Why is Google Analytics showing index.php after every page URL?

                    Hi, My client's site has GA tracking code gathering correct data on the site, but the pages are listed in GA as having /index.php at the end of every URL, although this does not appear when you visit the site pages. Even if there is a redirect happening for site visitors, shouldn't GA be showing the pages as their redirect destination, i.e. the URL that visitors actually see? Could this discrepancy be adversely affecting my search performance? Example page:  http://freshstarttax.com/innocent-spouse/ shows up in GA as http://freshstarttax.com/innocent-spouse/index.php thanks

                    Reporting & Analytics | | JMagary
                    0
                  • Darioz

                    Google Analytics: how many visits from country Google domains?

                    Hello, I manage a site with visitors from many different countries. With Google Analytics, it is normal to see the number of visitors from each search engine. However, I would like to identify the number of visitors from each Google-search contry domain. How many visitors from Google.com? How many from Google.co.uk. And from Google.co.zm? And so on. Anybody knows if this is possible and if yes, how can it be done? Thank you in advance, Dario

                    Reporting & Analytics | | Darioz
                    0

                  Get started with Moz Pro!

                  Unlock the power of advanced SEO tools and data-driven insights.

                  Start my free trial
                  Products
                  • Moz Pro
                  • Moz Local
                  • Moz API
                  • Moz Data
                  • STAT
                  • Product Updates
                  Moz Solutions
                  • SMB Solutions
                  • Agency Solutions
                  • Enterprise Solutions
                  Free SEO Tools
                  • Domain Authority Checker
                  • Link Explorer
                  • Keyword Explorer
                  • Competitive Research
                  • Brand Authority Checker
                  • MozBar Extension
                  • MozCast
                  Resources
                  • Blog
                  • SEO Learning Center
                  • Help Hub
                  • Beginner's Guide to SEO
                  • How-to Guides
                  • Moz Academy
                  • API Docs
                  About Moz
                  • About
                  • Team
                  • Careers
                  • Contact
                  Why Moz
                  • Case Studies
                  • Testimonials
                  Get Involved
                  • Become an Affiliate
                  • MozCon
                  • Webinars
                  • Practical Marketer Series
                  • MozPod
                  Connect with us

                  Contact the Help team

                  Join our newsletter
                  Moz logo
                  © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                  • Accessibility
                  • Terms of Use
                  • Privacy

                  Looks like your connection to Moz was lost, please wait while we try to reconnect.