25 Replies Latest reply on Aug 6, 2015 8:20 PM by Sanford Whiteman

    Form "Not You?" functionality

      Do any of you use "Not You?" buttons on forms (along side the Submit button)?

      If so, how do you do this functionality?
      Thanks!
        • Re: Form "Not You?" functionality
          Subscribing to this thread. ;-)
          • Re: Form "Not You?" functionality
            Alok Ramsisaria
            We are currently trying this for one of our clients. We are reading the Munchkin cookie and using the 'Not You' functionality for similar purpose. Hopefully, we will be able to share a detailed approach for this by coming week. :)
            • Re: Form "Not You?" functionality
              Rafael Santoni
              This is how we implemented it.

              We have a link in all our Marketo pages that asks the visitor to "click here" if the information on the form is not theirs to re-set the information. Once the person clicks on that, a javascript function we created clears the cookie and re-loads the page.

              In addition to that, we check for a URL parameter (userID=guest). If any of our pages are called with that URL parameter present, we also clear the Marketo prefill and all the fields prior to rendering the page. We do that with a short JavaScript function. This allows us to link to any of our Marketo lead capture pages forcing not pre-filling the forms even for known leads if we wanted to.

              Summary:
              1.           Create a function that would clear the values, cookie, etc.
              2.           Place link on your template to call the function to clear and reload the page.
              Simple, non-intrusive, and easy to deploy and maintain.

              If you wanted to apply the same functionality to the reset button on the form, you can use jQuery to "listen" to a click on the button and fire the same function or have it call the same page with the "magic" URL parameter.

              Good luck!

              Rafael

              1 of 1 people found this helpful
              • Re: Form "Not You?" functionality
                Adam Bennett
                Rafael
                Would you be willing to share the JQuery code that you use for this functionality?


                Thanks!
                Adam 
                • Re: Form "Not You?" functionality
                  Rafael Santoni
                  Sure thing. Let me put it together.
                  • Re: Form "Not You?" functionality
                    Rafael Santoni
                    This is what I do to make the "Clear" button reset the visitor properly

                         // Use jQuery via $jQ(...)
                         var $jQ = jQuery.noConflict();
                          
                         $jQ(document).ready(function(){
                          
                         // If Clear is clicked remove Marketo cookies, prefill, etc.
                         $jQ( "#mktFrmReset" ).click(function() {
                          
                         $jQ("#_mkt_trk").val('');
                                 mktoPreFillFields = {};
                                 $jQ(".lpeRegForm")[0].reset();
                                 document.cookie = '_mkto_trk=NULL; expires=-1; path=/; domain=.citrix.com';
                          
                         });
                          
                         });

                         I have not tested this on pages with forms from the Forms 2.0 editor, only on pages with the original forms editor.
                    • Re: Form "Not You?" functionality
                      Adam Bennett
                      Thanks much Rafael!
                      • Re: Form "Not You?" functionality
                        Rafael Santoni
                        No problem Adam. Any time.

                        BTW... this is how I do it with the URL parameter (if the URL has userId=guest):

                             if(Mkto.getUrlParam("userId") == "guest"){
                                     $jQ("#_mkt_trk").val('');
                                     mktoPreFillFields = {};
                                     $jQ(".lpeRegForm")[0].reset();
                                     document.cookie = '_mkto_trk=NULL; expires=-1; path=/; domain=.citrix.com';
                                 }
                        
                        
                        
                        
                        • Re: Form "Not You?" functionality
                          Adam Bennett
                          Thanks again.  

                          I was just working on implementing this today and after playing around with a 2.0 form, I was able to get this working there as well.  The form name referenced in the reset should be ".mktoForm" instead of ".lpeRegForm".  

                          So this:
                          $jQ(".lpeRegForm")[0].reset();

                          Should become this:

                          $jQ(".mktoForm")[0].reset();

                          And everything should work.  

                          Thanks!
                          Adam
                          • Re: Form "Not You?" functionality
                            Rafael Santoni
                            Hey Adam, I am curious about one thing. That would not work in my case because my forms never make use of that class. Mine consistently use lpeRegForm instead. Are you using the original form editor or version 2?
                            • Re: Form "Not You?" functionality
                              Rafael Santoni
                              Scratch my last comment, I just realized that you were working on 2.0 forms. Good to know. The other thing that could be done is to reset any form regardless of which class they are using. Since in most cases, there would be only one form, that should take care of both cases.

                              i.e.
                              $jQ("form")...
                              • Re: Form "Not You?" functionality
                                This is awesome! We are having issues in this area and this is likely one good way to help alleviate our problems too. Thanks!!
                                • Re: Form "Not You?" functionality
                                  [deleted]
                                  • Re: Form "Not You?" functionality
                                    Hopefully someone is still subscribed to this thread...

                                    If we wanted to make the clear happen via clicking on some text like "Not You? Click here..." how would we make that happen?

                                    As far as I can tell the javascript above is only for the "Clear" button that shows below the forms.

                                    My unsubscribe form has a bunch of text breaks and things, so having the clear button be all the way at the bottom doesn't serve my needs. I want to have text next to the email field that allows them to clear it there.

                                    Thanks!
                                    • Re: Form "Not You?" functionality
                                      Rafael Santoni
                                      The code I sampled here can be used in a regular text link, the submit button or even by loading the page with url parameters. If you have access to a JavaScript developer, it should be clear how to implement it. On my pages, I leverage it whenver the page is loaded with the url parameter userId=guest, so I simply use a relative text link on the page that links to the same page itself, including the url parameter.

                                      i.e. If the form pre-populated below is not you, 
                                         < a id="mktoGuest" href="?userId=guest">click here</a >

                                      But you could also invoke it by calling the function from a regular text link.

                                      The reset button does not necessarily clear the cookie values, just the field values but the person might still be recognized, so I ensure to remove all traces by doing both things at the same time.

                                      I hope that helps clarify it.

                                      Rafael
                                      • Re: Form "Not You?" functionality
                                        Thank you, Rafael, for the information and code! I'll be starting implementation and testing of this very soon on my company's Marketo registration pages.

                                        Hopefully this will be a built-in feature in a future release of the forms.

                                        Allison
                                        • Re: Form "Not You?" functionality
                                          Here is the jQuery that we will be implementing on our forms. It has been tested on Forms 2.0 and it resets the fields if the "Not You" link is clicked or if the URL has "user=guest" as a parameter.

                                          Note: I did change the previous "userID" to "user" to shorten it.

                                          jQuery(document).ready(function($){

                                              function resetMktoForm() {
                                                  $("#_mkt_trk").val('');
                                                  mktoPreFillFields = {};
                                                  $(".mktoForm")[0].reset();
                                                  document.cookie = '_mkto_trk=NULL; expires=-1; path=/; domain=.planview.com';
                                              }
                                              
                                              if(window.location.search.indexOf("user=guest") > -1){
                                                  resetMktoForm();
                                              }
                                              
                                              // If Clear is clicked remove Marketo cookies, prefill, etc.
                                              $('html').on('click', '.mktFrmReset', function (event) {
                                                  event.preventDefault();
                                                  resetMktoForm();
                                              });

                                          });

                                          Also, here is our "Not You" link code we have inserted as Rich Text in our form:

                                          <a href="#" class="mktFrmReset">Not You? Reset this form</a>

                                          We're still working on getting this to work with Progressive Profiling. Currently if Progressive Profiling is enabled and the "Not You" link is clicked, it does not completely refresh the form to show the Progressive Profiling fields that are not visible. It only resets the visible fields.

                                          My developer is working to make this work with Progressive Profiling, but I wanted to share what we have now. Enjoy!

                                          Allison
                                          2 of 2 people found this helpful
                                          • Re: Form "Not You?" functionality
                                            Yannick Lepere
                                            Thanks for the code it was very usefull but as mentioned above Marketo should integrate this as an option in the form builder. 

                                            - one option should be to create a link above the form (f.e. Not you? Click to clear form)
                                            - second option should be a button a the bottom of the form (F.e Clear Form)

                                            Both options should be available the first one if the form is pre-populated with details of someone else
                                            Second option I would use in case when it is a longer form and the user just wants to clear it at the end. 
                                            • Re: Form "Not You?" functionality

                                              Unfortunately this doesn't seem to work for me with Marketo's new guided templates!

                                               

                                              Has anyone got this working or have an alternative with the guided templates?

                                                • Re: Form "Not You?" functionality
                                                  Rafael Santoni

                                                  Matthew,

                                                   

                                                  I am sure it is possible even with those templates because the solution is not dependent on the template used. The Marketo cookie is "_mkto_trk" no matter what template you use and the prefilled values leverage the mktoPreFillFields array always. As long as you can destroy the cookie, it should work and clear the prefill values, you should be ok. Try putting the code below on one of your pages and visit the URL appending "?userId=guest" right after the page address. Make sure to replace the part that says "insert_your_domain_here" with your Marketo page URL domain name.

                                                   

                                                  <script>

                                                  $jQuery(document).ready(function(){

                                                  if(Mkto.getUrlParam("userId") == "guest"){

                                                           $jQuery("#_mkt_trk").val('');

                                                           mktoPreFillFields = {};

                                                           $jQuery(".lpeRegForm")[0].reset();

                                                           document.cookie = '_mkto_trk=NULL; expires=-1; path=/; domain=.insert_your_domain_here.com';

                                                       }  

                                                  });

                                                  </script>

                                                   

                                                  By the way, there might be some tweaks needed for this code to work depending on the form you are using on the page.

                                                   

                                                  If you have any problems implementing it, feel free to drop me a line at rafael.santoni@citrix.com

                                                   

                                                  Good luck!

                                                   

                                                  Rafael

                                                    • Re: Form "Not You?" functionality
                                                      Sanford Whiteman

                                                      Rafael, really shouldn't use NULL here because misleadingly implies it has a special value, but it's just a literal four-letter string "NULL" in the cookie context.  For example, if I do document.cookie='abc123=NULL ... ' I'll then have a cookie named abc123 with value "NULL".  Instead, when deleting a cookie, use an empty value to signify your intent to delete it: document.cookie='_mkto_trk=; ... ';

                                                       

                                                      Also, Forms 2.0 doesn't have the #_mkt_trk field, so you don't need to clear its value, though I suppose it's harmless to use it.

                                                       

                                                      Perhaps more important than the above, your code has a race condition if you try to use it with embedded forms (including when the external embed code is used on Marketo-hosted LPs).  It'll sometimes work and sometimes not.  You should use the Marketo Forms 2.0 API (the whenReady event) to ensure that the form actually exists in the DOM at the point you try to reset it.  Don't try to guess when the form is in the page, let the form itself tell you when it is ready to be filled/reset/modified.

                                                    • Re: Form "Not You?" functionality
                                                      Sanford Whiteman

                                                      Matthew, the most accurate way to do this (on any page, including a GLP) is illustrated in the script at the bottom of this page: http://pages.vaneck.com/Lab-GLP-Guest-Form.html

                                                       

                                                      As noted above, you should use the Forms 2.0 API. The API has a whenReady event that tells you when the form is ready for use.  Any other attempt to time when the form is ready (and therefore ready to be reset) relies on luck.

                                                    • Re: Form "Not You?" functionality
                                                      Courtney McAra

                                                      Small plug for LaunchPoint Partner Marketera who can help with things like this - aka a Resource Center

                                                       

                                                      Marketing Design: Web, Email, Social, & Print – Marketo LaunchPoint