: Parameters in the Server part or Client part of URL I want to store the search history which a user has followed to find a product. It can arrive to the landing page of the product through
I want to store the search history which a user has followed to find a product. It can arrive to the landing page of the product through numerous paths, so I want them stored somewhere. I have discarded a cookie approach, as I would like to allow the user to send the URL to another user and still keep the data. So I thought of storing a database ticket which goes in the URL. But now I am doutbful about storing in the server part of the URL, for instance, example.com/products/sport-shoes/5eb63bbbe01eeed093cb22bb8f5acdc3
or in the client part,
example.com/products/sport-shoes/#5eb63bbbe01eeed093cb22bb8f5acdc3
This later approach obliges me to load the content via AJAX. Which is more convenient with respect to SEO and other considerations?
More posts by @Connie744
2 Comments
Sorted by latest first Latest Oldest Best
Another approach you can take is logging in to Webmaster tools and adding a URL parameter, indicating whether or not it will affect the user's on-page experience. Based on the settings, you can let Googlebot decide which URLs to crawl or define it yourself. I had to configure the setting myself because of a session id getting added to my parameters.
support.google.com/webmasters/answer/6080548?rd=1
The ticket string in the URL is basically irrelevant to a search engine. From what I understand, both cases would serve the same page content (about the /sport-shoes/ product and may include minor customisations like related products, etc based on the ticket string).
Thus, in both cases, you would be better off in terms of SEO by using a rel="canonical" link element to the <head> section on both, the canonical page (original /sport-shoes/ page) and the duplicate variant (with the ticket string) as follows:
<link rel="canonical" href="https://www.example.com/products/sport-shoes" />
Note: You must use an absolute path rather than relative path in the href attribute to avoid errors. A helpful resource is the Use canonical URLs page in Google's guidelines.
I can't think of any other major considerations as such. But generally, I would recommend that you avoid complicating your URL to keep it simple and readable for humans, especially when shared on blogs and social media. If your goal of using the ticket string is tracking user behaviour, try and achieve this by using advanced tracking and analytics.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.