Not sure why Marketo makes it so hard to pass a program ID within the standard embed code

Brian_Horace
Level 2

Not sure why Marketo makes it so hard to pass a program ID within the standard embed code

Maybe I'm missing something... the standard embed code allows you to pass the formid, why not the programid?

 

<script src="//pages.fiscalnote.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_1017"></form>
<script>MktoForms2.loadForm("//pages.fiscalnote.com", "---ILL-989", 1017);</script>

 

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: Not sure why Marketo makes it so hard to pass a program ID within the standard embed code

What is "the" program ID of a global form, though? Some forms don't have an associated program, and some are implicitly tied to more than one program.

 

There's no form-related action on the back end that uses a program id, but if you wanted to use a custom field and consult it in a Smart List, you can do:

MktoForms2.whenReady(function(mktoForm){
  mktoForm.addHiddenFields({
     relatedProgramId : 1234
  });
});

 

Brian_Horace
Level 2

Re: Not sure why Marketo makes it so hard to pass a program ID within the standard embed code

This particular form is a form we use for gated content, so with each piece of content the program id is different, if that makes sense.

SanfordWhiteman
Level 10 - Community Moderator

Re: Not sure why Marketo makes it so hard to pass a program ID within the standard embed code


This particular form is a form we use for gated content, so with each piece of content the program id is different, if that makes sense.

What's the real relationship between the form and the Marketo program?

 

Is the form on a Marketo LP that's within a program? Because if so, the Web Page constraint is the name of the LP.

Brian_Horace
Level 2

Re: Not sure why Marketo makes it so hard to pass a program ID within the standard embed code

The form allows the user access to downloading the asset (usually a pdf).

Amy_Goldfine
Level 10 - Community Advisor

Re: Not sure why Marketo makes it so hard to pass a program ID within the standard embed code

Hi Brian, what are you trying to accomplish here? Can you elaborate more?

Amy Goldfine
Marketo Champion & Adobe Community Advisor
Brian_Horace
Level 2

Re: Not sure why Marketo makes it so hard to pass a program ID within the standard embed code

Hey there, so we have our main site and we have a couple of standalone sites. What I am trying to do is have a marketo embed that I can place on my blog posts that gates content. The form ID doesnt need to change but the program ID would change per use so it knows which content to serve up. I think Im stating that correctly.

SanfordWhiteman
Level 10 - Community Moderator

Re: Not sure why Marketo makes it so hard to pass a program ID within the standard embed code

I think what’s still fuzzy here is exactly how you’re connecting the Program and “its (single) piece of content.“

 

In Marketo, there’s no native property of a Program called “content”. A program can relate to one or more Design Studio assets, or one or more external URLs for that matter. But, as self-evident as it might seem in your particular setup, there’s no default thing that connects a Program to a downloadable.

 

This is not to say there aren’t easy ways of implementing such a connection. For example, a {{my.token}} called {{my.download url}} fills the bill. But it’s not precisely clear that’s what you’re doing.

 

The reason I’ve been wondering above about your chosen implementation is it’s quite possible to have the same global form switch between Thank You URLs (which can be downloadable assets — they certainly don’t need to be pages) based on a field on the form. For example, create an Integer field Last Form Program ID. Then add that to the form as a Hidden field; set it based on the URL of the page or any other criteria. Have the Thank You URL choices based on that field.