SOLVED

Using multiple form conditions to determine thank you page - GDPR

Go to solution
Tyria_Saul
Level 2

Hi all,

I'm building our first ever subscription center for GDPR and I'm trying to get my form to send users to different thank you pages based on their choices. For example, they can opt out of email and/or opt out of cookie tracking. If they opt-in to email and opt-out of tracking we need to send them to a certain landing page with the no tracking url on it. If they opt-out of email but opt-into tracking we need to send them to a different thank you page, etc. There are four different thank you pages in total. I can't figure out how to do this in Advanced Thank you. I can set a single condition, like send them to page A if they choose email opt out, but I can't figure out how to send them to page A if they choose email and date opt-out. Any suggestions would be greatly appreciated!

How are others doing this in their subscription centers? By the way I'm using both Marketo landing pages and forms.

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

MktoForms2.whenReady(function(form){
  form.onSubmit(function(form){

    var currentValues = form.getValues(),

    fieldsToConsolidate = ["fieldA","fieldB","fieldC"],

    consolidated__c =

      fieldsToConsolidate

        .map(function(field){

          return currentValues[field];

        })

        .join(";");

   form.addHiddenFields({ consolidated__c : consolidated__c });

});

});

Where consolidated__c is the name of your new custom field and fieldA, fieldB, and fieldC are the names you want to put together.

The resulting consolidated__c field will be a semicolon-delimited string (apples;oranges;pumpkins) so needless to say, the values themselves can't contain a semicolon.

View solution in original post

28 REPLIES 28