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.

Brad Bell
  • 67,440
  • 6
  • 73
  • 143
9er
  • 179
  • 9

1 Answers1

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

Brad Bell
  • 67,440
  • 6
  • 73
  • 143