1

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.

0

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

https://github.com/nystudio107/cookies

https://github.com/lewisjenkins/craft-lj-cookies

https://straightupcraft.com/craft-plugins/?q=cookie

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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