WordPress is very foreign to me. I have a site with clickable (tracking) links, and would like to append the query parameters that come through to the page to the end of the URL, and stay in the browser after the user clicks to next page. (In the end these params get passed back to my tracking system, I use them to optimize my page.)
Currently, the params disappear when user clicks “next”. I would like the params to carry from page to page, regardless of what the user clicks.
This is the current script in the Tracking Code on WP (enabled to run on all pages, after )
Example link in code:
<!--nextpage--> <h1>1. Stuff! </h1> words!<a class="add-query-params" href="http://track.link.com/example/1">Page 1</a></span> <!--nextpage--> <h1>2. Things! </h1> words!<a class="add-query-params" href="http://track.link.com/example/2">Page 2</a></span>
Ideally, the user would populate the URL with the parameters, and it would look something like this:
However WP removes all the params each time the user clicks “Next”, or another article on the page.
I considered saving the url to a variable, and appending the query params, and saving it as a new custom variable, however I didn’t know how to do that/if it would work.
This is my first SO question, so please forgive me if you hate it! Suggestions for plugins are also appreciated! Thanks everyone :)!