Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Add parameters to all urls in real-time marketing email

(0) ShareShare
ReportReport
Posted on by 2

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:

  • utm_source=marketing
  • utm_medium=email
  • utm_campaign=happy_holidayz

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

  • NiklasM Profile Picture
    25 on at
    RE: Add parameters to all urls in real-time marketing email

    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

  • Olasan Profile Picture
    2 on at
    RE: Add parameters to all urls in real-time marketing email

    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.

    Skjermbilde-2022_2D00_06_2D00_02-101802.png

    Skjermbilde-2022_2D00_06_2D00_02-101936.png

  • NiklasM Profile Picture
    25 on at
    RE: Add parameters to all urls in real-time marketing email

    Hey Ola,

    would it be possible to show me how you did this? I am excited about this automation?

    Best regards

    Niklas

  • Olasan Profile Picture
    2 on at
    RE: Add parameters to all urls in real-time marketing email

    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.

    pastedimage1644612724724v1.png

    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...

  • danielftk Profile Picture
    on at
    RE: Add parameters to all urls in real-time marketing email

    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:

    Forum.gif

    You can even use the personalization feature to set the parameter values dynamically.

    Hope it helps. 

    Regards.

    Daniel

  • Olasan Profile Picture
    2 on at
    RE: Add parameters to all urls in real-time marketing email

    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

  • Suggested answer
    Nya Profile Picture
    29,060 on at
    RE: Add parameters to all urls in real-time marketing email

    Hi Ola,

    Please refer to the following documentation:

    Real-time marketing link tracking mechanics (Dynamics 365 Marketing) | Microsoft Docs

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Holly Huffman Profile Picture

Holly Huffman 103

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 96 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 51 Most Valuable Professional

Product updates

Dynamics 365 release plans