Will this unsubscribe method work?

Anonymous
Not applicable

Will this unsubscribe method work?

Normally you point this code (in the admin section) to a page with your unsubscribe form. When the form is filled out (and unsubscribed is set to true, Marketo recognizes the "Unsubscribed from email....".
Unsubscribe: %mkt_opt_out_prefix%UnsubscribePage.html?mkt_unsubscribe=1&mkt_tok=##MKT_TOK##.

In my case I want to point the unsubscribe link to an email preference center. This has a form to update your desired topics. And it has an big button (hyperlinked image) to fully unsubscribe.

So there are two scenarios to unsubscribe. You click the unsubscribe link on that page and that will trigger a data change of the unsubscibed field. Or you uncheck all checkboxes in the preference form, which will also trigger a data change of the unsubscibed field.

I want to know if Marketo recognizes the "Unsubscribe dfrom email" with both methods.
Tags (1)
3 REPLIES 3
Anonymous
Not applicable

Re: Will this unsubscribe method work?

I control my unsubscribe form with an operational flow that recognizes the completion of the form or a specific criteria. I would think that a similar method would work for you if direct reconition is not possible.
Josh_Hill13
Level 10 - Champion Alumni

Re: Will this unsubscribe method work?

So you are taking their instructions too literally.

Default = this is the code you are showing. It is designed to set the Unsubscribed=TRUE to the hidden field on the default form and page Marketo gives you.

Email Subscription Center - this is the special page you created. 
When you are ready to make this live:

1. Copy the Admin > Email > HTML and Text code to a text file. SAVE THIS.
2. Edit the html in there to point to your Email Sub Center. At a minimum, you can replace "%mkt_opt_out_prefix%UnsubscribePage.html?mkt_unsubscribe=1&mkt_tok=##MKT_TOK##." with "http://go.yoursite.com/preference-center.html"

that will work just fine. TEST THIS.

3. Press Save. ...this is now live on all outgoing emails, including Samples.

Alternatively, you can continue to use both links, just add your new link like:

Please <A HREF="
http://go.yoursite.com/preference-center.html">manage your preferences</A> or "%mkt_opt_out_prefix%UnsubscribePage.html?mkt_unsubscribe=1&mkt_tok=##MKT_TOK##">Unsubscribe</A>.

This may be preferable to comply with CASL.


On the FORM itself, you may want to add javascript that says, if "Unsubscribe=TRUE", then uncheck all other options" 
I agree that you can have a workflow handle that for you, but the user experience may require you to show they are all unchecked.
Anonymous
Not applicable

Re: Will this unsubscribe method work?

I solved some big things in my email preference center in forms2.0, by using the Forms2.0 Javascript API. http://developers.marketo.com/documentation/websites/forms-2-0/

Based on the fields populated I added a script to manipulate the data. I have added the code below, for anyone interested.

<script>
    //Written by Diederik Martens (C) 2014
    MktoForms2.whenReady(function (form){
        //check for unsubscribe at any change
        form.onSubmit(function(){
            //get the form field values
            var vals = form.vals();
            //if all unchecked > unsubscribe
            if(vals.ePCNews == "No" && vals.ePCEvents == "No" && vals.ePCContent == "No" && vals.ePCLogistics == "No" && vals.ePCProduction == "No" && vals.ePCWorkforce == "No" && vals.ePCSCPO == "No" && vals.ePCSOP == "No") {
                form.vals({"Unsubscribed":"true"});
                form.vals({"Email_Opt_in__c":"false"});    
            } else {
            //something (type or topic) is still checked so we keep opt-in
                //any of the 3 types is still checked
                if(vals.ePCNews == "Yes" || vals.ePCEvents == "Yes" || vals.ePCContent == "Yes") {
                    //check if any topic is also check
                    if(vals.ePCLogistics == "Yes" || vals.ePCProduction == "Yes" || vals.ePCWorkforce == "Yes" || vals.ePCSCPO == "Yes" || vals.ePCSOP == "Yes") {
                        //at least 1 topic is checked so don't interfere. but do record optin
                        form.vals({"Unsubscribed":"false"});
                        form.vals({"Email_Opt_in__c":"true"});    
                    } else {
                        //none of the topics are checked, whilist at least 1 type is checked. so check all topics by default
                        form.vals({"Unsubscribed":"false"});
                        form.vals({"Email_Opt_in__c":"true"});    
                        form.vals({"ePCLogistics":"Yes"});
                        form.vals({"ePCProduction":"Yes"});
                        form.vals({"ePCSCPO":"Yes"});
                        form.vals({"ePCSOP":"Yes"});
                        form.vals({"ePCWorkforce":"Yes"});                        
                    }
                }
                //none of the 3 types are checked
                else {
                    //check if any topic is checked.
                    if(vals.ePCLogistics == "Yes" || vals.ePCProduction == "Yes" || vals.ePCWorkforce == "Yes" || vals.ePCSCPO == "Yes" || vals.ePCSOP == "Yes") {
                        //at least 1 topic is checked, whilist no type is checked, lets keep the person opt-in, but which type to check? check all.
                        form.vals({"Unsubscribed":"false"});
                        form.vals({"Email_Opt_in__c":"true"});    
                        form.vals({"ePCNews":"Yes"});
                        form.vals({"ePCEvents":"Yes"});
                        form.vals({"ePCContent":"Yes"});
                    } else {
                        //no topics are checked, and no types are checked, so opt-out
                        form.vals({"Unsubscribed":"true"});
                        form.vals({"Email_Opt_in__c":"false"});    
                        form.vals({"ePCNews":"No"});
                        form.vals({"ePCEvents":"No"});
                        form.vals({"ePCContent":"No"});
                        form.vals({"ePCLogistics":"No"});
                        form.vals({"ePCProduction":"No"});
                        form.vals({"ePCSCPO":"No"});
                        form.vals({"ePCSOP":"No"});
                        form.vals({"ePCWorkforce":"No"});
                    }
                }
            }        
            var valszz = form.vals();
            //alert("Submitted values: " + JSON.stringify(valszz));
        });
    });
</script>