Get the page URL when a form is filled

Hey guys

Does anyone know how can I find where in my site the lead filled a form?

I have the same form in many pages, so it would be very important to know the exact URL the user was when the form was filled

Thanks a lot!

2 Likes

Hey @eduardosh!

Here are two options for you. I’ll include one technical and one non.

First up is the technical: You can achieve this by adding a hidden field to each of your forms, and then populate it with Javascript. Your page URL location can be found in window.location.href, then just set your Javascript variable as the value of the hidden field. Let me know if you need more explanation!

Next is the the non-technical. This is really the fool-proof way, and will ensure that your contacts are directly attributed to a URL. Say you have a form on your contact page, your about page, and your team page. Let’s use a company/organization newsletter as the example. You would then create a form for each url with a naming convention, so you can easily reference a contact’s source.

2 Likes

Hi @Ted !

Thanks for the quick reply

I’m not very familiar with coding, but I went for the technical option because it will be much easier for me in the future.

So, I created a new field for all my lists, got the field name and used the code below:

<input type='hidden' id='field[10]' name='field[10]' value='' />

And on my Javascript, this:

document.getElementById('field[10]').value = window.location.href;

When I open the contact on ActiveCampaign looks nice, already showing the URL. Thanks a lot.

Just another question: as it is a hidden field, how can I show it on the notification e-mails?
Should I use a ‘text’ field and hide it via CSS? Or is there another way?

Thanks a lot!!!

Cheers

2 Likes

Fantastic! Happy to help :slight_smile: !

As it’s a notification email, all fields should come through in the message regardless of being hidden or not.

2 Likes

Hello there!
Our attribution feature may help you with this goal, please view more here: An overview of Attribution

ActiveCampaign Customer Experience Team.