anyone know where to access the body tags in forms?

Anonymous
Not applicable
need to add custom code to code in the body tag of forms
Tags (1)
15 REPLIES 15
Anonymous
Not applicable

For anyone trying to solve this in the future, I have figured it out!

You need to place the LinkedIn Autofill code in the HTML editor of the WYSIWYG of the form editor. You need to assure that your code is referencing the same form number ex: data-form="mktoForm_1124" that the code is being placed in.

Here is a sample of the LinkedIn code that we referenced in out HTML:

<script src="//platform.linkedin.com/in.js" type="text/javascript">

api_key: they verify this for you

noAuth: true

lang: en_US

</script>

<script type="IN/Form" data-form="mktoForm_1124" data-field-email="Email" data-field-company="Company"></script

Then you should be good to go!

AnnaBelle

Anonymous
Not applicable

During LinkedIn's fourth quarter earnings call, LinkedIn announced thee will be sunsetting LLA this year, which LinkedIn Auto-Fill is a part of: LinkedIn to shut down B2B ad platform 'Lead Accelerator' | Marketing Dive.

Anonymous
Not applicable

Hey Regie,

I am having the exact same issue with where to put that code! Did you ever seem to figure it out?

Thanks,

AnnaBelle

Justin_Cooperm2
Level 10

LinkedIn is discontinuing Lead Accelerator, so this won't be useful anymore.

Anonymous
Not applicable

Even though they are discontinuing LLA, it would still be useful for anyone who has a LinkedIn profile. We have paid media ads on LinkedIn, so I would love to figure out where to put that code.

AnnaBelle

SanfordWhiteman
Level 10 - Community Moderator

Forms don't have <body> tags. HTML documents (Marketo LPs or your own pages) have <body> tags.

SanfordWhiteman
Level 10 - Community Moderator
@Regie what I posted is a customized version of the Marketo embed code.

@Justin I think the LinkedIn code is supposed to fill the fields automatically (?) based on the mapping element (LI field = Mkto field) when it loads.  But this is a really terribly documented feature for a major platform. I hope it's still in beta....
Justin_Cooperm2
Level 10
Regie,

You would get the data you need from the LinkedIn API (like Sanford I don't know much about this, you should look into their documentation) and then update the form via JavaScript. Are you familiar with how to do this?

var textbox = document.getElementById("myTextBox");
textbox.value = "Something";

Instead of "something" you would fill that field with the value you retrieved from LinkedIn.
 
Anonymous
Not applicable
is it possible to add code to the form via the "embed code" feature? on the form's main page
Anonymous
Not applicable
But where in the marketo form code would I put this in? I can't imagine putting it within the css styles or anything


I don't mind testing it out myself
SanfordWhiteman
Level 10 - Community Moderator
I can tell you that this code duplicates what you provided using the Forms 2.0 API (injects the LinkedIn script dynamically after the Marketo form is loaded and refers to the Marketo fields).  Past that, I can't tell you much: documentation on the LI autofill feature is really scant.  You'd probably want to talk to the LI community next.
Anonymous
Not applicable
AH awesome. And thanks for the reply.

The following is my code, just need to know where to put it in:
 
<script src="//platform.linkedin.com/in.js" type="text/javascript">
  api_key: 757smum0z4yd79
  noAuth: true
  lang: en_US
</script>
<script type="IN/Form" data-form="Request Demo LinkedIn NEW" data-field-firstname="First Name" data-field-lastname="Last Name" data-field-phone="Phone Number" data-field-email="Company Email" data-field-company="Company"></script>
<script src="//platform.linkedin.com/in.js" type="text/javascript">
  api_key: 757smum0z4yd79
  noAuth: true
  lang: en_US
</script>



Thanks again
SanfordWhiteman
Level 10 - Community Moderator
@Regie K Please post a link to the LI code you're referring to.

Like @Justin C says HTML forms (Marketo forms are HTML <FORM> tags under the hood) never have <BODY> tags.  However the Forms 2.0 API is very flexible and almost certainly will let you execute your code in the form's initial callback (the 4th parameter to MktoForms2.loadForm()).
 
Anonymous
Not applicable
I'm trying to add a linkedin in auto-fill form code. so marketo has a linekdin option, but it takes about 2-3 steps to complete. I am trying to eliminate that step and add custom scripting code to be placed in the <body>
Justin_Cooperm2
Level 10
Forms don't have a <body> tag. A body tag defines the document's body. A form is one component within a document (webpage). Forms have other HTML elements. What specifically are you trying to do?