Mobile app version of vmapp.org
Login or Join
YK1175434

: URL param additions on page load w/o page reload SEO design I'm building a single page application and I'm using a client-side routing library to handle URL/state changes. Let's say Googlebot

@YK1175434

Posted in: #AngularJs #Javascript #Seo

I'm building a single page application and I'm using a client-side routing library to handle URL/state changes.

Let's say Googlebot visits example.com/my-shop-name/menu, the menu-items for my-shop-name are loaded dynamically and a URL parameter is immediately appended to the URL like so: example.com/my-shop-name/menu?top_item=some_item_id. top_item represents the item in a list of menu-items on the page that is currently at the top of the viewport. As the user scrolls, this parameter will naturally update as the top-most item changes. The point of this parameter is to remember the scroll position. It should also be pointed out that whenever the parameter is updated in the URL, the page never reloads.

My first question is: what URL will be indexed?


example.com/my-shop-name/menu


or


example.com/my-shop-name/menu?top_item=some_item_id


Secondly, if the latter is indexed, will instructing the web crawlers to ignore top_item as a URL parameter in robots.txt make it so the first URL is indexed and the latter is not?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @YK1175434

1 Comments

Sorted by latest first Latest Oldest Best

 

@Shelley277

what URL will be indexed?


Since Google is able to interpret JavaScript reasonably well these days then there is a good chance that both URLs could get indexed. If the second URL (with the URL parameter) is linked to then there is a very good chance that search engines will index both.

Since the content is "loaded dynamically", the URL with the parameter doesn't just represent a different "scroll position", but it potentially contains different content as well.


will instructing the web crawlers to ignore top_item as a URL parameter in robots.txt make it so the first URL is indexed and the latter is not?


I wouldn't block the URL in robots.txt. This will prevent the URL being crawled.

However, you could inform Google to "ignore top_item as a URL parameter" in Google Search Console.

Or simply include a <link rel="canonical" element in the head section pointing to the parameterless URL.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme