Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You can try to store the data in a cookie on the user’s browser. Use the PHP function setcookie(), which sets cookies via a HTML header, meaning setcookie() must be called before any page content is sent, as with any header. You can also set cookies using javascript if you need to set them after content is sent. The values are then available in $_COOKIE during subsequent page requests.

    Of course the user can disable cookies or javascript, but I think you will find the percentage that do so are quite low.

    Timothy Jacobs

    (@timothyblynjacobs)

    Since you are trying to keep this data for use with Google Analytics, and I assume you have many links on your page. What I’d do is write some Javascript to iterate over all of the URLs on the page, and add your custom query args onto the URL.

    Thread Starter ramooch

    (@ramooch)

    sorry but im pretty basic at html and code, can you explain me how to do this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Keep params in url when navigate?’ is closed to new replies.