I want to add source tracking to my Craft CMS site. Using Google Analytics I can track users through just about the entire process but can't see them as they go through account registration.

I want to simply add a query parameter to the {{ link }} from the activation email.

I can see that if I add {{ link }}&source=test that the additional query param shows up, however what I really want is something like this:

&source={{ craft.request.getCookie('traffic_src') }}

However the above solution returns the activation code and source= which leads me to believe that it is undefined

What is the best way to approach this problem of accessing a cookie for a user in one of Craft's email messages.

1 Answer 1


Assuming this is for Craft 2, there are a few cookie plugins that let you read and write cookie values from a Twig template.




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.