I am setting up my wp site and i have it setup like this www.mydomain.com/?ref=AFFILIATEID
thats alright if they land on the page they are directed to but if they go off page onto another one, how do i get the affiliate id to track through the site so that anywhere i put the link www.affiliatelink.com/ it will show who the referer is.
Also is there a way to set a default referer so that if someone came to the site www.mydomain.com it would have a defulat affiliate id set through out the site.
Im using the latest wordpress, self hosted and using the optimizepress theme
Thanks
James
Try using
add_query_arg()
.For example, if your query key is “ref”, and your query key value is “AFFILIATEID”:
If you need to retrieve your query arg value, use
get_query_var()
: