If you need to add tracking parameters in all your URLS in one simple way in your message, Send API offers the URLTags property. This solution will be perfect for passing UTM parameters for your traffic analytics in a easy way, without having to modify every single URLs in your message yourself.
You just need to provide the query part between the first "?" character and "#" character.
So if you want to have a URL in this format: http://www.example.com?param1=1¶m2=2
You will just need to specify : "URLTags":"param1=1¶m2=2"
In your HTMLPart or template, you will only need to specify the href http://www.example.com.
Mailjet will add the parameters in all of the URLs in your message, before adding the Mailjet click tracking and sending the message. The URLs in your click statistics will include the URLTags provided.
NOTICE: The string provided needs to be properly encoded (ie : space becomes %20, " becomes %22 ... ) see more information here
# This calls sends an email to one recipient.
curl -s \
-X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3.1/send \
-H 'Content-Type: application/json' \
-d '{
"Messages":[
{
"From": {
"Email": "pilot@mailjet.com",
"Name": "Mailjet Pilot"
},
"To": [
{
"Email": "passenger1@mailjet.com",
"Name": "passenger 1"
}
],
"Subject": "Your email flight plan!",
"TextPart": "Dear passenger 1, welcome to Mailjet! May the delivery force be with you!",
"HTMLPart": "<h3>Dear passenger 1, welcome to <a href=\"http://www.mailjet.com\">Mailjet</a>!</h3><br />May the delivery force be with you!",
"URLTags": "param1=1¶m2=2"
}
]
}'