How to Remove “https” From a URL and Update a New Field

0 Likes

How to Remove “https” From a URL and Update a New Field

Hi Team,

 

We have a field in Marketo that comes from our CRM ( Dynamics 365 ) , and it contains a full URL (MS Bookings link). We currently use it via the lead token in our emails, and the link works, but it doesn’t get tracked because the token URL includes “https”.

 

To address this, we're exploring the option of creating a new field and running a daily smart campaign to copy the value from the old field—but without the “https://” prefix and update it to the new one, so it can be tracked

 

Example:
Old field value: https://www.google.com
New field value: www.google.com

The idea is to update the new field using the old field’s value, removing the protocol. However, I’m unsure whether the Change Data Value flow step can handle this type of string transformation directly.

 

Could you advise on possible approaches to remove “https://” when updating the new field?

 

Any guidance on handling this scenario would be helpful.

 

Please let me know if you need anything else.

 

Regards,

Akshat

10 Comments
Jasbir_Kaur
Level 5

Hi @ashah123 - You can try the below options, if these can help -

 

Marketo's Change Data Value flow step does not support direct string manipulations, such as removing "https://" from a URL, as it only allows static values, tokens, or simple concatenations without regular expressions or substring functions.

Use a triggered Smart Campaign that fires on changes to the old field (e.g., MS Bookings URL from Dynamics 365). Integrate FlowBoost (a webhook service) to strip the protocol via JavaScript, then map the cleaned output back to the new field.

  • Set trigger: "Data Value Changes" on old field where value is known (e.g., starts with "https://").

  • Add "Call Webhook" flow step pointing to FlowBoost.

  • In webhook payload: urlWithoutProtocol = {{lead.OldField}}.replace(/^https?:\/\//,""); (handles both http/https).

  • Map response to new field (e.g., "Bookings Link Clean").

This avoids daily batch runs, processes only changes, and ensures tracking in emails by using the new token outside any protocol (e.g., https://{{lead.Bookings Link Clean}}).

2. Alternative: Velocity Script Token

For email-only use (not permanent field update), wrap the old field in a Velocity token at the program/landing page level: #set($cleanUrl = $lead.OldField.replaceFirst('^https?://', '')) $cleanUrl. Then reference {{my.CleanUrlToken}} in emails. This doesn't alter fields but enables tracking without a new field.

Test in a small batch first, as Dynamics sync might overwrite the old field—consider blocking updates on the new field if needed.

SanfordWhiteman
Level 10 - Community Moderator

☝️

ashah123
Level 3

Thanks @Jasbir_Kaur That helps alot , i did tried the option 2 which you shared and it works fine and we are planning to go ahead with that approach

Jasbir_Kaur
Level 5

Hi @ashah123 —Glad to know. If the solution works for you, please mark this topic as an accepted solution so this can be closed.

 

Thank you!

ashah123
Level 3

@Jasbir_Kaur Apologies for the delay in my response , i had an issue last week with the same test i was doing but today i tested it again and it looks good , so should be good.

ashah123
Level 3

@Jasbir_Kaur I accidentally had created this as an idea instead of a discussion , i am not sure where would be an option for me to mark this as a accepted solution ? i couldnt find it on my side

ashah123
Level 3

@Jasbir_Kaur / @SanfordWhiteman I wanted to loop you in on a scenario where I could need your guidance and expertise.

 

Based on the suggestions you shared earlier, we’re now able to make the link trackable by adding it as an anchor within the Velocity script. This link is used in snippets that sit across multiple campaigns, so my plan is to handle the update at the parent folder level. That way, the change automatically flows down to all child campaigns and remains manageable.

 

The challenge I’m running into is with the gcname (utm_campaign) parameter in the URL, which differs for each campaign and is currently managed using My Tokens. For example:

http://google.com/?utm_campaign={{my.Delivery_Description}}&contact={{lead.contact}}

The contact parameter feels straightforward to handle by setting the value at the top of the Velocity script. However, I’m unsure of the best way to reference or dynamically pull the My Token value ({{my.Delivery_Description}}) within the Velocity script itself.

 

One option I considered was manually overriding the token at the campaign level, but given the number of campaigns involved, I’m hoping there’s a more scalable or cleaner approach.

 

Would love to hear your thoughts on how you’d recommend handling this, or if there’s a best practice I might be missing here.

 

Thanks in advance for your help.

Regards,
Akshat

SanfordWhiteman
Level 10 - Community Moderator

One option I considered was manually overriding the token at the campaign level

Not sure I understand how you’d have different values without overriding for each campaign?

 

However, you should use a Velocity {{my.token}} for it to make things easier, not a Text {{my.token}}.

ashah123
Level 3

@SanfordWhiteman 

The override option I was referring to keeps the base link (anchor link ) the same and only changes the UTM campaign name per campaign. A Velocity token at the parent level would apply to all emails, and I’d then manually override the UTM campaign field with a static value at the campaign level by going into the velocity script at each program . This works, but it’s time-consuming given the number of emails. Please let me know if this makes sense.

 

You also mentioned using a Velocity my token instead of a Text my token. Could you help clarify this? Currently, each email has a static, unique UTM campaign value defined as a my token. If Velocity handles the full link and anchor, I’m not sure how the UTM campaign would be uniquely set per email in the velocity and how to refer that my token created as a static value?. An example would really help.

 

ashah123_0-1768340787560.png

ashah123_1-1768340812881.png

Currently, this is how I’m doing it when its not related to snippet. What I’m trying to figure out is a scalable solution where the same snippet can be used across all emails, while still allowing me to update the utm_campaign value via a My Token and pass it into the Velocity script

 

Do le me know in case of anything

 

Regards,

Akshat

ashah123
Level 3

@SanfordWhitemanCould you please guide me on the above—specifically on the best way to make it easier to fetch the utm_campaign, considering it will be different for each campaign?