Sendgrid how get click tracking link

1k Views Asked by At

When I made clickTracking: true option in @sendgrid/mail API v3, this is work fine and my links modified, but when I use AMP-emails I have dynamic custom links and I can't trigger click event. I need a way, how get this modified link which triggers the click event, or I need a option how send click event data to API sendgrid. I need to manually trigger a click event.

Example of a modified link:

http://ur123456.website.com/ls/click?upn=GNQ0Y-2FRud123pJSNJOPFTPfjwJ-2F9X71r7qLU3SBdb4745wVI-3DEtcA_nx1QKxP5K9TFoBZ-2Fz3K-2FiEAlKmIrVx72dFsYBr12fl-2Br8WvWtRge-2B9lHeVXh0HaMja395gHzISC7UDCV1231dOTaWPhiq-2FAFaKGi2qym7shXhIH0Su5b4w4-2FfERisM06r5GHpIuvzvJLmai9qztFocXEBsHeqF-2Fjp-2FeilXXlqngdgvkDDttn9-2FxmOn8zQomq5xL63f8xfuF7ikp123W3PXyGTH2-2BzyQNgEm6Nsxv123MzdkpBfFOpg-3D
1

There are 1 best solutions below

3
On

Twilio SendGrid developer evangelist here.

I don't know of a way to manually trigger a click event, but there are some workarounds to have dynamic custom links. According to this page in the docs on click tracking best practices if you can still include the domain, it will still work:

<a href="{{ birthday_url }}"></a> will not work. Instead you should format your link like this: <a href="http://yoursite.com/{{ birthday_url }}"></a>