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/5eb63bbbe01eeed093cb22bb8f5acdc3or in the client part,www.example.com/products/sport-shoes/#5eb63bbbe01eeed093cb22bb8f5acdc3This later approach obliges me to load the content via AJAX. Which is more convenient with respect to SEO and other considerations?
Parameters in the Server part or Client part of URL
seo;url;ajax
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.