ActiveCampaign Forum

How to dynamically add hidden field input


#1

We’d like to create a form that displays when a button is clicked to download a file on our site (so the user would fill out a form before actually downloading the file). And we’d like that form to capture the unique link of the file being downloaded (of which there are hundreds). Is there a way to dynamically add a tag or input to a hidden custom field based on what button was clicked to display the form?

Like, I want to grab the href of the file link and record that this user downloaded that file. Not sure if this is a job for event tracking or if this would require more custom JavaScript to auto-populate the form?

Also note that we want to be able to record all files that a user has downloaded in case they download more than one.


#2

Hi there,

Just popping in real quick. At this time, ActiveCampaign can’t natively display a form when a button is clicked. You would need to code that behavior in using custom coding.

Other forum users may have an integration they can suggest for this behavior or you could reach out to one of our third-party certified consultants to assist with the coding found here: https://www.activecampaign.com/consultants/

You could also set up event tracking to take note of which button on your page was clicked and then be able to see which contact triggered which event. To see this at a glance, you may also want to have the event triggering add a tag via an automation.

I suggest adding a tag over capturing the the data in a hidden field, as whenever new data enters a custom field, it overwrites the previous data, so you would only see the most recent button clicked.

Let me know if you need any clarification or have any other questions.

Thank you,
Cody