Persist URL variables in links across the site

Brenden Kehren asked on January 6, 2016 22:51

Have a strange request to have URL variables persist across all the links when a visitor comes from say a Google Ad. The Google Ad has say 10 or 15 URL parameters and my client would like those to persist in the URL for that persons visit to the site. So say they come to the site and navigate around to 8 pages, 7 of those links they clicked would have the URL parameters in them. And it would have to be on every link on every page no matter where they are on the site.

Any ideas or suggestions on how I might approach this? JavaScript? Url Rewrite? IIS config? Output filter?

Correct Answer

Jim Spillane answered on January 7, 2016 01:10

Hi Brenden.

If it is a Google ad, you might try checking the _utm* cookies like _utmz for the querystring parameters.

0 votesVote for this answer Unmark Correct answer

Recent Answers

David te Kloese answered on January 7, 2016 00:34

Hi Brenden,

Don't think you should always maintain all parameters. As this would be a pain for instance when you have some paging or search via query string parameters.

If you could determine a set of parameters that need to be maintained I'd create a webpart or usercontrol and place that on the master page. Probably make this set of parameters manageable.

Think Javascript would be the quickest way to update all your links, but could go wrong on non redirecting links. So think 'Output filter' would be a good place to start.



1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 7, 2016 01:31

Ahh yes, forgot all about that, Thanks Jim!

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.