Good afternoon,
I've created an Email Script Token ({{my.SFDC_Type}}) as follows:
#if( $lead.SFDC_Type.equals("Lead") )
#set( $sfdcindicator = "1" )
#elseif( $lead.SFDC_Type.equals("Contact") )
#set( $sfdcindicator = "2" )
#else
#set( $sfdcindicator = "0" )
#end
${sfdcindicator}
The token is to be appended to email links as a querystring, e.g. https://www.companynam.com/global/en/corporate/?sfdc_type={{my.SFDC-Type}} and when the email is previewed, the URL renders as expected, e.g. https://www.companynam.com/global/en/corporate/?sfdc_type=1
However, when the email is sent, the value is not present in the email URL:
What might be the reason for this, especially because the value does display when the token is included in the email body:
Any help would be greatly appreciated.
Kind regards
Karl
Solved! Go to Solution.
Didn’t specifically mean Formula field. Use a standard Number field and set it nightly using Change Data Value w/choices. (Filter on people who’ve had changes to the underlying fields in the previous day.)
Also not sure why you’re adding Original Source Type in there. Someone who originated in Marketo can be synced to SFDC.
Your script works fine for me.
But you use my.SFDC-Type on your URL parameter, but the name of the token is my.SFDC_Type, isn't it?
I wonder, like Michael says, if you don’t have a typo in this particular test.
But fundamentally, what you’re trying to do is not supported. You must output the entire <a>
tag from Velocity, not just parts of the href
. (In other words, you can’t piece together a URL from parts outside and inside Velocity.)
So you shouldn’t rely on this method either way — there have been many twists and turns over the years in what seems to work in Velocity vs. what’s guaranteed to work. Only outputting the entire <a>
works, unless you disable tracking.
Also bear in mind SFDC Type isn’t meaningful unless you also check SFDC Is Deleted. For this task, I would have a separate calculated field instead of what you’re doing.
Hi Michael and Sandford,
thank you both for your replies and apologies Michael, the initial reference to the program token was a typo and the correct name is {{my.SFDC-Type}} as referenced in the URL tests.
To Sandford's reply, I did come across feedback from yourself to another user with a similar use case. I conducted a subsequent successful test constructing the full <a> reference within the token.
This is great, but my use case in this instance is to append this parameter to all URLs in an email to serve Adobe Analytics reporting, specifically so users can distinguish between lead and contact web activity.
With this in mind, would the solution be to create an Email Script token for every distinct URL in an email as this feels cumbersome and would likely intimidate marketing users?
I did, as suggested create a calculated field, including the SFDC Is Deleted field within the logic, and appended that field as a token to a URL to test but I received the following error message:
Calculated Field:
Append to URL:
Preview:
Attempt to execute:
Any further ideas would be appreciated please.
Regards
Karl
Didn’t specifically mean Formula field. Use a standard Number field and set it nightly using Change Data Value w/choices. (Filter on people who’ve had changes to the underlying fields in the previous day.)
Also not sure why you’re adding Original Source Type in there. Someone who originated in Marketo can be synced to SFDC.
Thanks Sandford, apologies for the delay in responding. I can confirm that the suggestion to run a nightly smart campaign to maintain the field value works and this field in turn, can be successfully added as a querystring to email URLs.
Thank you very much for all the feedback.