How to pass a value of a downloaded asset on a central pop-up form? | Community
Skip to main content
Kristof-2
Level 4
April 7, 2025
Solved

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

  • April 7, 2025
  • 1 reply
  • 447 views

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:
 
Best answer by SanfordWhiteman

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 }); });

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
April 7, 2025

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 }); });