Hi community, I'm trying to add UTM-parameters to the Email in Real-Time Marketing. Adding the fields is OK (just add collumns to E-mail, and add fields to forms Email Header and Information (main form). However, what I want to do is to add these parameters to all links/URLs in the email when it is sent.
So, lets say I have these fields:
And then, in the email I have 14 different URLs (on images or in text). I want to add these to the URLs without neccecsarily showing it in the URL field. So if I have an image with the URL set to
https://community.dynamics.com
I want it to say
https://community.dynamics.com?utm_source=marketing&utm_medium=email&utm_campaign=happy_holidayz
when its used. Of course not medding up Marketings own parameters added to links (if any).
I'm thinking som kind of plugin/workflow to run whenever an email is set to "ready to send".
Anyone done something similar? Is the only way to parse "email body" for all URL html tags and try to insert my own parameters there?
All ideas welcome! Thanks.
Ola
Hey Ola,
thanks a lot. Its not working as I expect, is it possible to share the steps in detail?
The hint to use classic to add the fields saved my life since this is unfortunately not possible in the new UI.
Thanks a lot!
Best regards
Niklas
Hi,
1 - add collumns to msdynmkt_mail table; utm_content, utm_campaign, utm_medium and utm_source
2 - add these fields to the Information form (this must be done in Classic mode!)
3 - create a Cloud Flow to add utm tags to content in email, which triggers on "When Email record is added or modified".
The flow is not particularly elegant, but it works. The process is:
1. Whenever email record is updated or created, retrieve all utm values and create an url tail (ie. "&utm_campaig=value&utm_content=value...."), for this I use the concat-function.
2. Get email content from both collumns msdynmkt_emailbody and msdynmkt_designer, put these in variables (these will be updated with new URLs)
3. Create an array of URLs in the mail. This is brute force, look for the first http, and use substring function to put the entire URL in the array, start searching for the next URL from there (I use some helper parameters here)
4. For each URL in the array; find them in the email content and replace them with the value + UTM-tail
5. Update record with new values for body and design (from step 2).
Some sort of regular expression support would've been nice. But since this flow is not time dependant, it works ok.
Hey Ola,
would it be possible to show me how you did this? I am excited about this automation?
Best regards
Niklas
Thanks Daniel,
I know I can set the parameters manually like you show here, and add som fields from the contact, segment or compliance center into the mix with personalisation. However, that means I need to sett these parameters manually for ALL the links in the email. This could be 5, or this could be 15.
Right now, I'm close to nailing it. I've added the fields into the Email Properties table.
And I've created a Cloud Flow which triggers when record in Email table is changed or created. This table have to collumns for HTML, one for "Body" and one for "Designer". I guess I need to add the parameters on the URLs in both...
Another way of doing it would be to create a table for "UTM Parameter Sets", and iif possible, used it from personalization...
Hi Ola,
As per my understanding. If you mean "automatically" adding that parameters to all the URLs inside the email when you mark it as ready to send. You may need to go for the plugin/custom way.
Currently you can easily add that parameters by using the OOTB email designer:
You can even use the personalization feature to set the parameter values dynamically.
Hope it helps.
Regards.
Daniel
Hi Nya, thanks for the reply. However I don't see this helping me... it only tells what happens to the URL when the email is used in a journey. I want to add these parameters to the URL inside the email - before they're transformed to be tracked in marketing. Or am I missing something here?
Regards,
Ola
Hi Ola,
Please refer to the following documentation:
Real-time marketing link tracking mechanics (Dynamics 365 Marketing) | Microsoft Docs
Holly Huffman
103
Muhammad Shahzad Sh...
96
Most Valuable Professional
Gerardo RenterÃa Ga...
51
Most Valuable Professional