I'm currently installing a few lines of jQuery on several non-hubspot pages. The pages have a hubspot form with a hidden field that the jQuery should automatically populate with the page URL upon form submission.
The URL should then be stored in a contact property called registration_backlink.
The logic is to use the contact property called registration_backlink in order to create dynamic buttons in emails so each person is referred to register and submit their details on an updated version of the page they visited before. What's the best way to go about doing this?
An alternative to the whole process would be to enroll contacts into an active list based on the URL they came from and send them an email with smart content based on list city but as we're running hundreds of events we would be running out of active lists!
User visits https://ww1.qstopmba.com/events/qs-world-mba-tour/europe/st-petersburg
User clicks Green button and form pops up.
User fills in form and jQuery fires by adding https://ww1.qstopmba.com/events/qs-world-mba-tour/europe/st-petersburg into the contact property registration_backlink
When event details are published, User receives an email with a dynamic URL button, in this case linking to https://ww1.qstopmba.com/events/qs-world-mba-tour/europe/st-petersburg
This is a non-hubspot page, but we use a hubspot form.
The link above is a test-website and may appear as usafe to visit on some browsers
The jQuery we're using for this is:
var getURL = window.location.href;