Updated: Sep 2, 2024
How to add a custom redirect after a survey is submitted
Using Google Tag Manager, you can create a custom redirect for any time a subscriber submits a survey, in place of the confirmation page. This creates a perfect opportunity for you to keep your audience engaging with your content by redirecting them back to a page of your choice.
Quick tips to get you started
-
Sign in to Google Tag Manager: To create a custom redirect as outlined here, you’ll need to have a Google Tag Manager (GTM) account.
- Go to tagmanager.google.com and sign in. Make sure you are using a Google account.
- Connect your GTM account to beehiiv: Before proceeding, ensure your Google Tag Manager account is connected to your beehiiv account.
-
Create a survey: You’ll need an existing survey to set up a custom redirect.
- If you haven't created one yet, read this article to learn more about surveys and how to create them.
- Signup Flow redirects: If you're using a subscribe survey within a Signup Flow, you can already redirect your audience to continue through the flow and add a custom redirect at the end.
How to add a custom redirect to a survey
- Set up a custom trigger and tag in your Google Tag Manager account. Begin by creating a custom trigger in GTM to detect when someone completes your survey. After that, create a tag that executes the redirect code.
- Log into your beehiiv account and from your left panel Dashboard, navigate to Audience > Surveys.
- The surveys you’ve created will be listed. Locate the survey you want to create the redirect for, and click the three dots menu.
- Select Copy url.
-
Go to tagmanager.google.com and sign in to your Tag Manager workspace.
- From the left hand panel in your Google Tag Manager workspace, click Triggers > New.
- For the Trigger Type, enter Click-All Elements.
- Toggle the selection to Some Clicks.
- Add the following filters:
- Click text equals: Continue
- Page URL contains: [Your survey form URL]
- Name the trigger something descriptive, like ‘Click Continue on Survey Form’.
- From the left hand panel in your Google Tag Manager workspace, click Tags > New.
- Type Custom HTML.
- In the field, paste the following code. Replace “[redirect URL]” with the URL of the page you want to redirect users to.
<script>
window.location.href="[redirect URL]"
</script> -
Under Trigger, select the trigger you created in steps 4-11.
- Give this new tag a name like ‘Survey Form Redirect’. Click Save.
- Publish your changes and test the setup by submitting responses to your survey and clicking Continue.