SOLVED

Velocity Scripting with URLs for Fields

Go to solution
nhabischWings
Level 5

Velocity Scripting with URLs for Fields

Hello!

Two questions regarding using velocity and pulling in URLs from custom objects fields:

1) I was curious how timed content from a velocity script acts once it hits the inbox. For example, if I have a script that "shows X URL for the next 15 days" - once it is in someone's inbox I am assuming that since a click would pull the redirect and browser that the script would kick in and if they were outside the time parameters the URL would not show/work?

 

Ex: Show https://google.com from 6/12 - 6/15. Email send on 6/12. Recipient opens from inbox on 6/16. When link is clicked script updates URL and original URL is not shown?

2) I believe I read that URLs pulled using "#foreach" are not trackable. Does this include if the script is pulling from a field with URL as content? So for something like this:

#foreach ($item in $itemObject)
#if ( !$item.urlField.isEmpty() )
$item.urlField
#end
#end

If the URL exists within the field, would that mean it's not tracked as a click event or even a "Link Contains x" to change a program status or anything?

2 ACCEPTED SOLUTIONS

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Scripting with URLs for Fields


1) I was curious how timed content from a velocity script acts once it hits the inbox. For example, if I have a script that "shows X URL for the next 15 days" - once it is in someone's inbox I am assuming that since a click would pull the redirect and browser that the script would kick in and if they were outside the time parameters the URL would not show/work?


Not getting what you mean here. Velocity executes once, only within Marketo, at the time the email is assembled. It does not re-run later after the email is in the inbox. The assembled email content is static.

View solution in original post

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Velocity Scripting with URLs for Fields

Yes, as the email isn't gonna query Marketo for values after it's sent to the recipient, so the content won't change after the script has run and the email has been sent to the person (i.e., even if you clear out the lead fields/CO records that you referenced in your velocity, the data in the email won't change, as it's static once sent). Some clients (like Gmail) do support showing dynamic content based on when the recipient sees the email, but you can't build such emails with velocity, you need AMP for that.

 

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Scripting with URLs for Fields


1) I was curious how timed content from a velocity script acts once it hits the inbox. For example, if I have a script that "shows X URL for the next 15 days" - once it is in someone's inbox I am assuming that since a click would pull the redirect and browser that the script would kick in and if they were outside the time parameters the URL would not show/work?


Not getting what you mean here. Velocity executes once, only within Marketo, at the time the email is assembled. It does not re-run later after the email is in the inbox. The assembled email content is static.

nhabischWings
Level 5

Re: Velocity Scripting with URLs for Fields

Hello,

That is exactly what I was trying to double-check. I wasn't sure if when someone clicked a link tied to a script that had specific date parameters if it would re-run/check the scripting on load.

 

Let's say promo runs from 6/1-6/5. Email goes out on 6/1, but recipient doesn't click the link until 6/7. So the link would in theory still persist even if someone clicked if after the scripted promo period ended?

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Velocity Scripting with URLs for Fields

Yes, as the email isn't gonna query Marketo for values after it's sent to the recipient, so the content won't change after the script has run and the email has been sent to the person (i.e., even if you clear out the lead fields/CO records that you referenced in your velocity, the data in the email won't change, as it's static once sent). Some clients (like Gmail) do support showing dynamic content based on when the recipient sees the email, but you can't build such emails with velocity, you need AMP for that.

 

nhabischWings
Level 5

Re: Velocity Scripting with URLs for Fields

Got it, thank you both!

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Scripting with URLs for Fields

You could have the page itself redirect or change its contents after a certain date (using JS). But you can't make the email content do anything different.