Collecting an id from url

I have given some compnaies our site url and at the end of it an id, pretty much like below:

Thats just off the top of my head, the next bit is where Im going ot ask whats the best way to handle this.

So what Im thinking is, when they land on my site I gather the data after ? and eventually when they get to the shop page that will influence a ‘Where did you hear about us’ drop down to automatically select their business, so when its purchased that business name will appear in the invoice we recieve, so then we know which business it came from.

What I need to know is, when that customer is on the site but going from page to page before going to the shop page, how is it best to pass that value around the site, and when they leave the site it clears I suppose.

Hope that makes sense in what I am trying to achieve

Essentially you are describing the definition of sessionStorage.

1 Like

As m_hutley mentioned, this is pretty iconic for a Web Storage API such as sessionStorage or localStorage. In the past we’d have simply used cookies, but these two options are simpler and more modern.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.