SOLVED

How to pass a value of a downloaded asset on a central pop-up form?

Go to solution
Kristof
Level 4

How to pass a value of a downloaded asset on a central pop-up form?

Hey,

we are trying to use a single Marketo Form on the website that presents multiple gated assets.  And we would like to pass a value on the form for which asset was downloaded.
 
We are struggling to determine mechanism to pass that value - which specific asset is being downloaded. 

Each asset listed on this page has a "Learn more" button which is a java script code, based on which a pop-up with a centralized form opens.

Any ideas? See the page mock up below:
 
image.png
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: How to pass a value of a downloaded asset on a central pop-up form?

Pretty simple: when they click the button, write the most recently clicked asset URL to a hidden field.

/* 
wherever you first know the clicked document URL 
assume it’s stored in the variable `currentDocumentURL`
*/
MktoForms2.whenReady(function(readyForm){
  readyForm.addHiddenFields({
    lastDownloadURL: currentDocumentURL
  });
});

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: How to pass a value of a downloaded asset on a central pop-up form?

Pretty simple: when they click the button, write the most recently clicked asset URL to a hidden field.

/* 
wherever you first know the clicked document URL 
assume it’s stored in the variable `currentDocumentURL`
*/
MktoForms2.whenReady(function(readyForm){
  readyForm.addHiddenFields({
    lastDownloadURL: currentDocumentURL
  });
});