Community & Support

Best place to intercept extra URL parameters

I am implementing simple affiliate functionality, e.g. site.com/page?affiliate=affiliate-name (in the case of clean urls).
Where is the best place to hook to intercept those extra parameters, so that I can set a custom cookie?

I know of three:

hook_init()
hook_menu()
_phptemplate_variables

I am currently using hook_init() but would like to know what the best-practice is.

I want to always intercept these parameters, even in the case of a cached page.
Thanks!

Comments

how about let your parameters

how about let your parameters be free and catch it with arg? or maybe htaccess can do some for you.

nobody click here