How to run scripts when the Signup Form is submitted?
Prefinery provides you the ability to easily execute custom code or scripts when the signup form is submitted. This is particularly useful for integrating 3rd-party analytics tools with your campaigns like Segment, or to add each new user in your project into your own mailing list on platforms like Mailchimp.
While Prefinery already easily integrates with popular analytics tools like Google Analytics and Facebook Pixel, we're providing you a way to use your own custom scripts so you can do more after the user submits your form.
From your project dashboard, navigate to Signup Form, then select the JS tab.
In the Conversion Tracking Code box, paste in your custom script.
Hit Save when done.
Prefinery let's you access data for the user who submitted the form with your custom script in the variable named
Here are the currently supported values:
||The person's email address|
||The person's first name|
||The person's last name|
||The person's referral code|
||The person's referral link|
||When the person was added to your campaign|
||The created user's unique ID in the system|
<script> // Show email address of user who submitted the form console.log('Email: ' + prefinery_data.user.email); // Show prefinery_data object, which displays all data console.dir(prefinery_data); </script>
Here are other examples:
- Pass user data as redirect URL parameters on form submit
- Send event to Segment on form submit
- Add Prefinery user as Mailchimp subscriber on form submit
- Send event to Google Analytics on form submit
- Send event data to Facebook on submit button click
- How to add extra pages (bridge pages) after form-submit action before showing the referral page