Post/get parameters to be used as custom variable

Hi guys, i am struggling for days.

My system sends campaigns emails to customers. Each email has a customerID and campaignID in parameter(GET). I would like to be able to store those parameters as custom variables. I added a script that does that but it works only on the first page and not on every page the user visit as those URL do not have the parameters.

If you can not understand what I have tried, please tell me the best way i can track a customer that click on the link in the email sent to him. I guess that link should have the campaignID and customerID as GET parameters.

If you track these variables as “Scope = visit” then it only needs set at the first page view and will be stored for this visit. Maybe you used scope = page instead?