The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

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

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Web Design
    4. Responsive design and Google analytics mobile tracking codes?

    Responsive design and Google analytics mobile tracking codes?

    Web Design
    2 2 1.2k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Sarbs
      Sarbs last edited by

      Hi all,

      We are currently rebuilding a site using responsive design, however i have just had a thought. On another site where we have a mobile site under a sub-directory we utilise mobile tracking codes as we found that this was far more accurate for recording visits.

      On a responsive design site evidently all pages, desktop and mobile, will be under the same URL, yet the content will adjust to the screen size of the device. Should we also change the tracking code to be mobile code on the lower resolutions or would the same code be sufficient?

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

        Rich,

        Because responsive design inherently only uses one html file, what you're describing isn't so simple. Obviously, you only want to include 1 GA tracking code, but you COULD include some logic that fires a different one on page load depending on detected screen width. I think your best bet is to just use the standard GA code in your HTML, then include some JS that detects which of the layouts are displayed on load, and sends it in a custom variable. Alternatively, GA, by default, will capture screen size as a data point, so, as long as your responsiveness is working properly, you can just create segments in GA based on those and view site behavior accordingly.

        Mike

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        • Does Designing in Sigma Reduce Coding Costs
          0
          1
          29

        • AMP vs Responsive Design? Mobile SEO
          bridget.randolph
          bridget.randolph
          1
          3
          2.3k

        • Going mobile: Responsive or different mobile version?
          Leonie-Kramer
          Leonie-Kramer
          0
          4
          114

        • Responsive Design vs Mobile For This Site?
          KempRugeLawGroup
          KempRugeLawGroup
          0
          4
          296

        • Does Google penalize duplicate website design?
          Tiberiu
          Tiberiu
          0
          9
          2.0k

        • Best way to add Google Analytics to a Joomla!
          Ties.com
          Ties.com
          1
          6
          1.0k

        • Ecommerce & Responsive design
          Jungles
          Jungles
          0
          9
          524

        • Responsive Vs Mobile Sites
          Nobody1560986989723
          Nobody1560986989723
          0
          4
          683

        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
        • Digital Marketers
        Free SEO Tools
        • Domain Authority Checker
        • Link Explorer
        • Keyword Explorer
        • Competitive Research
        • Brand Authority Checker
        • Local Citation 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 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
        • Accessibility
        • Terms of Use
        • Privacy