How to Integrate with Google Forms
Google Forms is a free-to-use, web-based application that allows you to create online forms and surveys with multiple question types.
By integrating Prefinery with Google Forms, you can send your newly signed-up campaign users to a Google Forms survey - with their names and email addresses already pre-filled on the form.
Here's how:
Note: This requires that you're using the Prefinery embedded form or popup form on your website. In summary, the user would land on your website, fill out and submit the Prefinery form, then get redirected to the Google Form to continue filling it the request of the questions and then submit it.
1.) After creating your Google Form, edit it and as shown below get a pre-filled link for it.
2.) A new tab/window will open like as shown below where you can set what values goes into the fields as prefills. Referring to the Variables section of another guide, you will use Prefinery variables like prefinery_data.user.profile.first_name
, prefinery_data.user.profile.last_name
and prefinery_data.user.email
as values for these supported fields. Click Get link when done then COPY LINK.
3.) In your Prefinery project/campaign dashboard, go to Signup Form > JS tab, then set your form to redirect to your Google Forms pre-filled link on submit as described here: How to pass user data as redirect URL parameters on form submit
That means your script could be like as follows:
<script>
window.top.location.href = "https://docs.google.com/forms/d/e/1FAIpQLSdj513CAN6vlRcouKlabcNGnNiTbVVLL276a6Yq0jCnClDplA/viewform?usp=pp_url&entry.2005620554=" + prefinery_data.user.profile.first_name + "&entry.1720916381=" + prefinery_data.user.profile.last_name + "&entry.1045781291=" + prefinery_data.user.email;
</script>
IMPORTANT: Notice how given the original pre-filled link like as follows...
https://docs.google.com/forms/d/e/1FAIpQLSdj513CAN6vlRcouKlabcNGnNiTbVVLL276a6Yq0jCnClDplA/viewform?usp=pp_url&entry.2005620554=prefinery_data.user.profile.first_name&entry.1720916381=prefinery_data.user.profile.last_name&entry.1045781291=prefinery_data.user.email
...it gets modified once used in the script like as follows where the Prefinery variables are no longer within the link's quote-wrapped (string) parts:
"https://docs.google.com/forms/d/e/1FAIpQLSdj513CAN6vlRcouKlabcNGnNiTbVVLL276a6Yq0jCnClDplA/viewform?usp=pp_url&entry.2005620554=" + prefinery_data.user.profile.first_name + "&entry.1720916381=" + prefinery_data.user.profile.last_name + "&entry.1045781291=" + prefinery_data.user.email
This ensures that the actual values (actual name and email address) automatically replaces the variables in the script to complete the final pre-filled link.
Save your changes when done if it hasn't autosaved yet.
At this point, when the user submits your Prefinery form, they get redirected to your Google Form but no longer needs to enter their name and email address again. That's it!