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

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • 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. Technical SEO
  4. Does Google read dynamic canonical tags?

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.

Does Google read dynamic canonical tags?

Technical SEO
3
5
1.2k
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.
  • SoulSurfer8
    SoulSurfer8 last edited by Aug 7, 2017, 10:52 PM

    Does Google recognize rel=canonical tag if loaded dynamically via javascript? Here's what we're using to load:

    <script> //Inject canonical link into page head
        if (window.location.href.indexOf("/subdirname1") != -1) {
            canonicalLink = window.location.href.replace("/kapiolani", "");
        }
        if (window.location.href.indexOf("/subdirname2") != -1) {
            canonicalLink = window.location.href.replace("/straub", "");
        }
        if (window.location.href.indexOf("/subdirname3") != -1) {
            canonicalLink = window.location.href.replace("/pali-momi", "");
        }
        if (window.location.href.indexOf("/subdirname4") != -1) {
            canonicalLink = window.location.href.replace("/wilcox", "");
        }
        if (canonicalLink != window.location.href) {
            var link = document.createElement('link');
            link.rel = 'canonical';
            link.href = canonicalLink;
            document.head.appendChild(link);
        } script>
    
    1 Reply Last reply Reply Quote 0
    • SoulSurfer8
      SoulSurfer8 @andy.bigbangthemes last edited by Aug 15, 2017, 3:53 PM Aug 15, 2017, 3:53 PM

      I believe it's a limitation of our CMS. I'll see if we can try it in htaccess or PHP. Thanks for the insight.

      1 Reply Last reply Reply Quote 0
      • SoulSurfer8
        SoulSurfer8 @donsilvernail last edited by Aug 15, 2017, 3:52 PM Aug 15, 2017, 3:52 PM

        Thanks for the reply. Doesn't appear Google is recognizing the tag because duplicate pages with it are still showing up in SERPs.

        1 Reply Last reply Reply Quote 0
        • topic:timeago_earlier,7 days
        • andy.bigbangthemes
          andy.bigbangthemes last edited by Aug 15, 2017, 3:51 PM Aug 8, 2017, 7:01 AM

          I Wouldn't bet on that working. Why not use the exact same code in .htaccess format, or even PHP? Javascript is a coding language that is parsed after the window starts loading, it's not like PHP where it gets parsed before the load.

          Thanks

          SoulSurfer8 1 Reply Last reply Aug 15, 2017, 3:53 PM Reply Quote 1
          • donsilvernail
            donsilvernail last edited by Aug 7, 2017, 11:13 PM Aug 7, 2017, 11:13 PM

            Hi SoulSurfer,

            Read This http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157

            The google bot was able to read rel=nofollow and links were not followed. So I would think the same for rel=canonical as well.

            Thanks,

            Don

            SoulSurfer8 1 Reply Last reply Aug 15, 2017, 3:52 PM Reply Quote 1
            • 1 / 1
            1 out of 5
            • First post
              1/5
              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

            • Trevorneo

              What punctuation can you use in meta tags? Are there any Google does not like?

              So I know you can use dashes and | in meta tags, but can anyone tell me what other punctuation you can use? Also, it'd be great to know what punctuation you can't use. Thanks!

              Technical SEO | Aug 24, 2015, 9:04 PM | Trevorneo
              1
            • BridgetGibbons

              Isnt it better to have headlines in H1 and H2 tags instead of p tags?

              I am working with a simple site http://http://lightsigns.com/Uniko_Manufacturing_Limited.html They seek more SEO traffic. However, the two big headlines that read "Wholesale Supply to the Sign and Display Industries" which is on line 241 and 242 of the source code, its in a p tag, i.e. <p <span class="webkit-html-tag">style</p <span>="padding-top: 0pt; " class="paragraph_style_1">Wholesale Supply to the and <p <span class="webkit-html-tag">style</p <span>="padding-bottom: 0pt; " class="paragraph_style_1">Sign and Display Industries Likewise, the product titles are in p tags, also. For example, on the Slide-in Light Box product page, http://lightsigns.com/Slide_In_light_box.html , I have done keyword research and no one is using the words slide in light box.Plus, it is also a p tag, ie. line 43 reads style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style">Slide-in Light Box If I suggest that they make an H2 tag with SEO-optimized keywords such as Display Light Box - Slide-In LIght Box, would this indeed help SEO? In summary, is it correct to say that H1 and H2 tags are stronger signals to the search bots of what the page is about?

              Technical SEO | Apr 18, 2013, 4:25 PM | BridgetGibbons
              1
            • tjhossy

              Do canonical tags pass all of the link juice onto the URL they point to?

              I have an ecommerce website where the category pages have various sorting and paging options which add a suffix to the URLs. My site is setup so the root category URL, domain.com/category-name, has a canonical tag pointing to domain.com/category-name/page1/price however all links, both interner & external, point to the former (i.e. domain.com/category-name). I would like to know whether all of the link juice is being passed onto the canonical tag URL? Otherwise should I change the canonical tag to point the other way? Thanks!

              Technical SEO | Jan 14, 2013, 8:08 PM | tjhossy
              0
            • LukeHutchinson

              Should I include tags in sitemap?

              Hello All, I was wondering if you should include tags and categories in your sitemap. In the past on previous blogs I have always left tags and categories out. The reason for this is a good friend of mine who has been doing SEO for a long time and inhouse always told me that this would result in duplicate content. I thought that it would be a great idea to get some input from the SEOmoz community as this obviously has a big affect on your blog and the number of pages indexed. Any help would be great. Thanks, Luke Hutchinson.

              Technical SEO | Dec 16, 2012, 7:27 PM | LukeHutchinson
              1
            • lighttable

              • symbol in title tag

              We have a few title tags with a circular dot symbol, which is created by the code "•" Humans see a dot, but googlebot sees • Does this negatively impact our SEO, or is googlebot aware that **• == *** to human eyes

              Technical SEO | Oct 24, 2012, 4:30 AM | lighttable
              0
            • RefundFX

              Ranking on google.com.au but not google.com

              Hi there, we (www.refundfx.com.au)  rank on google.com.au for some keywords that we target, but we do not rank at all on google.com, is that because we only use a .com.au domain and not a .com domain? We are an Australian company but our customers come from all over the world so we don't want to miss out on the google.com searches. Any help in this regard is appreciated. Thanks.

              Technical SEO | Jun 8, 2012, 8:47 PM | RefundFX
              0
            • blake-76624

              Header Tags

              Ok so I am writing different pages and the first heading is an H3 just because I wanted to it be a certain size.  Then as you see the content, I have an H1 tag. Example page: http://www.oxfordmshomes.net/condos/acadia-court-Oxford-MS you can see that "Acadia First" is the first thing you see on the page and it uses an H3 element. Long story short, my hierarchy is wrong.  Does this have any negative effect on my SEO efforts?

              Technical SEO | Nov 13, 2011, 10:19 AM | blake-76624
              0
            • Hakkasan

              Google Off/On Tags

              I came across this article about telling google not to crawl a portion of a webpage, but I never hear anyone in the SEO community talk about them. http://perishablepress.com/press/2009/08/23/tell-google-to-not-index-certain-parts-of-your-page/ Does anyone use these and find them to be effective? If not, how do you suggest noindexing/canonicalizing a portion of a page to avoid duplicate content that shows up on multiple pages?

              Technical SEO | Oct 28, 2011, 12:32 PM | Hakkasan
              1

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