15 Replies Latest reply on Feb 9, 2017 11:59 AM by Allison Isett

    Marketo Sync: Lead Owner Question: Personalisation

    Allison Isett

      Marketing Community:

       

      Do you know if I change the “Marketo Sync” Name in SFDC to be something else if it will Mess up the sync? We are doing a lot more personalisation for sign-offs in email’s and if a name/lead doesn’t have a lead owner it defaults to "marketo sync." Is there a work around here that's easy where I do not have to have magical developer powers??

        • Re: Marketo Sync: Lead Owner Question: Personalisation
          Dory Viscogliosi

          Hey Allison, this is a great use case for velocity scripting. You can use the lead owner name if it isn't Marketo Sync, and if it is Marketo Sync you can have it add a different value.

          • Re: Marketo Sync: Lead Owner Question: Personalisation
            Sanford Whiteman

            Please move the thread to Products as it's Marketo-product-specific.

             

            Like Dory said, Velocity is the way to go. Whether you consider this magical is up to you :

             

            ##----SET DEFAULT DISPLAY NAME----
            #set( $defaultLeadOwnerFriendly = "Your Rep" )
            ##
            ##----SET SPECIFIC NAMES TO TREAT AS BLANK----
            #set( $deFactoEmpty = [ "Marketo Sync", "Obsolete Owner" ] )
            ##
            ##----NO NEED TO EDIT BELOW THIS LINE!----
            #set( $leadOwnerFriendly = "$!{lead.Lead_Owner_First_Name} $!{lead.Lead_Owner_Last_Name}" )
            #set( $leadOwnerFriendly = $leadOwnerFriendly.trim() )
            #if( $leadOwnerFriendly.isEmpty() || $deFactoEmpty.contains($leadOwnerFriendly) )
              #set( $leadOwnerFriendly = $defaultLeadOwnerFriendly )
            #end
            ${leadOwnerFriendly}
            
              • Re: Marketo Sync: Lead Owner Question: Personalisation
                Allison Isett

                How do I move this to marketo products?

                 

                Also, where do I put the script code you wrote above?

                  • Re: Marketo Sync: Lead Owner Question: Personalisation
                    Sanford Whiteman

                    There should be a "Move" link on the right nav bar when you edit the post.

                     

                    Velocity ("Email Script") tokens are added, like the other {{my.token}} types like Text*, Rich Text/HTML, and Calendar tokens, at the Folder or Program level.

                     

                    Then you reference them in your email by the token name: {{my.leadOwnerDetector}} for example.

                     

                    * A Velocity token without any special code and just the one line "hello" is basically identical to the Text token "hello." It's with the addition of #set and #if conditions that Velo comes alive.

                    2 of 2 people found this helpful
                  • Re: Marketo Sync: Lead Owner Question: Personalisation
                    Allison Isett

                    Sanford,

                     

                    I have tried this code in the email script token:

                     

                    #set( $defaultLeadOwnerFriendly = "The Team at eOriginal" ) 

                    #set( $deFactoEmpty = [ "Marketo Sync" ] ) 

                    #set( $leadOwnerFriendly = "$!{lead.Lead_Owner_First_Name} $!{lead.Lead_Owner_Last_Name}" ) 

                    #if( $leadOwnerFriendly.isEmpty() || $deFactoEmpty.contains("Marketo Sync") ) 

                      #set( $leadOwnerFriendly = $defaultLeadOwnerFriendly ) 

                    #end 

                    ${leadOwnerFriendly}

                     

                    It is only returning the default "The Team at eOriginal"

                    even when the lead owner isn't empty and defacto empty is marketo. What am I doing wrong here? I've tested in a test smart campaign to myself as a lead with a sales rep as the owner, so the lead owner would not have been empty or marketo sync, can you please help?

                    <- where my script is, and token name

                      • Re: Marketo Sync: Lead Owner Question: Personalisation
                        Grégoire Michel

                        Hi Alison,

                         

                        Sanford's line below is faulty (it's so rare that I can correct Sanford's code, that I am jumping on the occasion )

                        #if( $leadOwnerFriendly.isEmpty() || $deFactoEmpty.contains("Marketo Sync") )

                        should be

                        #if( $leadOwnerFriendly.isEmpty() || $leadOwnerFriendly.contains("Marketo Sync") )

                        or even better, since you are setting the defactoempty:

                        #if( $leadOwnerFriendly.isEmpty() || $leadOwnerFriendly.contains($deFactoEmpty) )

                         

                        -Greg

                        1 of 1 people found this helpful
                          • Re: Marketo Sync: Lead Owner Question: Personalisation
                            Grégoire Michel

                            Fixed the last line (wrong copy/paste) in my post.

                             

                            -Greg

                            • Re: Marketo Sync: Lead Owner Question: Personalisation
                              Grégoire Michel

                              In fact, Sanford's code was not faulty (my bad), but the way you replaced "$deFactoEmpty.contains($leadOwnerFriendly))" with "$deFactoEmpty.contains("Marketo Sync"))" made it wrong as this is always true.

                               

                              So, the line should be

                              #if( $leadOwnerFriendly.isEmpty() || $deFactoEmpty.contains($leadOwnerFriendly) ) 

                              Sorry Sanford for doubting of you

                               

                              -Greg

                                • Re: Marketo Sync: Lead Owner Question: Personalisation
                                  Sanford Whiteman

                                  Ha, I was about to issue a defense.

                                   

                                  Yep, Allison, see where it says NO NEED TO EDIT BELOW THIS LINE?  You edited below that line.

                                   

                                  $deFactoEmpty is an array of all owner values that should be interpreted as empty (obselete values, placeholders, etc.).  Those values, as well as true empty values, are replaced by whatever you set as $defaultLeadValueFriendly.

                                    • Re: Marketo Sync: Lead Owner Question: Personalisation
                                      Allison Isett

                                      I'm Sorry   I edited because I pasted in what you had above and it was still not returning the lead owner... here's how I edited the top part without editing your bottom code...

                                      "Your Rep" I edited to show "The Team at eOriginal" as I wanted that to show when no lead owner was associated with record

                                      Then "Marketo Sync", was the only thing I left in their because I was not sure what "obsolete owner" was/or should be replaced with. Also, do I pasted this in with your "##--- ---- " lines? Sorry I am completely new to this and have a strong right brain, but slow left one. ;-)

                                       

                                      1. ##----SET DEFAULT DISPLAY NAME---- 
                                      2. #set( $defaultLeadOwnerFriendly = "Your Rep"
                                      3. ## 
                                      4. ##----SET SPECIFIC NAMES TO TREAT AS BLANK---- 
                                      5. #set( $deFactoEmpty = [ "Marketo Sync", "Obsolete Owner" ] ) 
                                      6. ## 
                                      7. ##----NO NEED TO EDIT BELOW THIS LINE!---- 
                                      8. #set( $leadOwnerFriendly = "$!{lead.Lead_Owner_First_Name} $!{lead.Lead_Owner_Last_Name}"
                                      9. #set( $leadOwnerFriendly = $leadOwnerFriendly.trim() ) 
                                      10. #if( $leadOwnerFriendly.isEmpty() || $deFactoEmpty.contains($leadOwnerFriendly) ) 
                                      11.   #set( $leadOwnerFriendly = $defaultLeadOwnerFriendly ) 
                                      12. #end 
                                      13. ${leadOwnerFriendly} 
                                  • Re: Marketo Sync: Lead Owner Question: Personalisation
                                    Allison Isett

                                    Thank you very much testing now.

                                     

                                    Can you tell me what the purpose of this line of code is: #set( $deFactoEmpty = [ "Marketo Sync" ] ) ?

                                    Why do I need that? Can I just have the whole token written the way it is below to accomplish the same thing?

                                    All I want to ensure is if the lead has marketo sync as the owner or owner is blank to use the default lead owner, otherwise it should be the assigned lead owner name...

                                     

                                    #set( $defaultLeadOwnerFriendly = "The Team at eOriginal" )

                                    #set( $leadOwnerFriendly = "$!{lead.Lead_Owner_First_Name} $!{lead.Lead_Owner_Last_Name}" )

                                    #if( $leadOwnerFriendly.isEmpty() || $leadOwnerFriendly.contains("Marketo Sync") )

                                      #set( $leadOwnerFriendly = $defaultLeadOwnerFriendly )

                                    #end

                                    ${leadOwnerFriendly}