0

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, www.example.com/products/sport-shoes/5eb63bbbe01eeed093cb22bb8f5acdc3

or in the client part,

www.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?

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.

  • Thanks for your reply. The ticket I see it as necessary because I need to know the search history to offer the customization. I also need to reproduce it later if the URL is sent via email or saved as a bookmark. If I used cookies, I would lose this last ability. One of the example of customization would be: you have a car part store. You put the brand and model of your car. There can be thousand of possible combinations, for the same product, and I would like to have the model introduced by the user hightlited. This can only be achieved if I introduce somehow the model in the landing page URL – Cesar Oct 6 '15 at 17:12
  • Why don't you just use human readable parameters in your URL? For the customisation example you've given, I would use: www.example.com/products/car-part-A?brand=BMW&model=5Series Wont this work? – macln Oct 6 '15 at 17:37
  • Yes, macIn, the problem is with the duplicate content. Google punishes duplicate content, so I think your approach could be valid, but I find the mix of URL-friendly and non-frienly parameters as not clean. Maybe www.example.com/products/car-part-A/#BMW-5Series and using Ajax to retrieve the different HTML code. – Cesar Oct 7 '15 at 6:12
  • @Cesar to clarify your misunderstanding, Google does not punish duplicate content on the same website. Many websites have different URL paths to reach the same content due to a variety of reasons, so it's perfectly ok to do so. Just remember to use the canonical link tag to point Google (and other search engines) to the preferred URL (which in your case should be the URL without the ticket string). Apart from that, any way you choose to serve the content, via the server or AJAX will have no effect whatsoever on your SEO in terms of the URL scheme you choose. – macln Oct 7 '15 at 11:59
  • Ok, macIn, thanks for the clarification. I will use your advice on the canonial links. I will use URL parameters "?var1=value1&var2=value2" to serve the content and in human readable format. Thanks! – Cesar Oct 7 '15 at 14:29
0

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.

https://support.google.com/webmasters/answer/6080548?rd=1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.