Using a token for a form follow up page | Community
Skip to main content
July 11, 2017
Solved

Using a token for a form follow up page

  • July 11, 2017
  • 1 reply
  • 6913 views

Our CRM is not currently integrated with Marketo and we need to automatically update the CRM when someone unsubscribes.

We had been using the following type of a link that was inserted in the footer of the email:

website.com/secure/en/!website.event_lib.dispatcher?p_event_name=emailUnsubscribe&p_email={{lead.Email Addre…

When the link was simply added to the email footer text it worked fine.

Now, we need to use an unsubscribe form and pass the same URL when the form is submitted.

I tried adding this URL as an external URL Thank You page. Marketo would not allow this URL because of the variable at the end. The error message said that only "my" tokens can be used. I have placed the unsubscribe form inside a program and created a program token "Unsubscribe" and placed the entire above string into the token value. However, i used a plain text token.

Then I inserted this program token into  form's thank you page external URL :

As a result, the URL was passed correctly, however the variable p_email={{lead.Email Address:default=}} wasn't recognized by CRM. I wonder whether it has to do with the fact that I used a plain text token or some other reasons?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

MktoForms2.whenReady(function(form){

  form.onSuccess(function(vals,tyURL){

    var crmTrackingBase = 'http​s://website.cst.org/secure/en/!website.event_lib.dispatcher?p_event_name=emailUnsubscribe&p_email=';

    document.location.href = crmTrackingBase + vals.Email;

    return false;

  });

});

Also see my answer here: Form Fields in External URL

1 reply

Jim_Thao7
New Participant
July 11, 2017

I believe it's because you can't use tokens w/in tokens.  The actual token itself will resolve it's content as a value rather than the token inside of that token as a value.  Not sure if that make sense the way I explained it.  Just take into a token will not resolve inside of a custom token. 

So you get: p_email={{lead.Email Address}} vs. p_email=something@something.com

July 11, 2017

Thanks, Jim! Is there another way to achieve the same objective? It's extremely critical for us to pass the Unsubscribe event into the CRM. It's also critical to use an unsubscribe form rather than a link to ensure proper unsubscribe in Marketo and accurate reporting.

Jim_Thao7
New Participant
July 11, 2017

Some ideas off the top of my head.

Don't use Marketo for the redirect on submission.  Instead, build a redirect using JS, grab the email from the form and concatenate it into your redirect URL for your TYP.  

On the email, link the UTM params you're looking to use, such as {{lead.email address}} and then script the TYP to retain the UTM params on form submission so the values get passed over to your TYP.