Integrating SurveySparrow with Google Tag Manager

Integrating SurveySparrow with Google Tag Manager

Venkata

Venkata

September 30, 2024

              

Google Tag Manager integration with SurveySparrow lets you track, analyze and improve the visitor analytics of your survey campaigns with the help of tags and covers a wide range of user interactions such as form submissions, click events, scroll events, page visits, etc. This data can be then pushed to various analytics tools like Google Analytics, Facebook Pixel, etc.

Integrating your Survey with Google Tag Manager

Let’s see how it’s done:

1. Login to your SurveySparrow account and choose a survey from the readymade templates or create a new survey and build it with your required questions.

2. Now, navigate to the integrate tab and enable the Google Tag Manager toggle

Screenshot 2024-09-30 at 6.20.47 PM.png

3. In the dialogue box, enter the Google Tag Manager tracking code of your workspace and click Connect to complete the integration process.

Screenshot 2024-09-30 at 6.23.26 PM.png

4. To find the GTM Tracking Code, Sign up for a Google Tag Manager account and create a new workspace. The GTM code can be found in the header section of your workspace.

Screenshot 30-09-2024 at 19.04.png

Here’s how you can track the page view when a survey is being viewed.

1. Navigate to the GTM dashboard and click on Tags > New or click "Add a new tag".

Screenshot 30-09-2024 at 19.08.png

2. In the Tag configuration window, choose Google Analytics: Universal Analytics as the tag type, and Page View as the Track type.

GTM 5.png

3. Then, in the Google Analytics Settings, enter your Google Analytics tracking code.

Image

4. Now, to create a new trigger, click on the Triggering section under the Tag Configuration.

Image

5. Click on the Plus sign at the top right corner and then click again on the triggering section as you can see in the above screenshot.

6. Select Page View from the options and click Save.

Screenshot 30-09-2024 at 19.12 (1).png

Image

7. Now whenever a survey is viewed, GTM pushes a page view to Google Analytics.

Screenshot 30-09-2024 at 19.14.png

Here’s how you can fire an event when the page is loaded

Screenshot 2024-09-30 at 6.56.36 PM.png

1. First, to create an event, go to the GTM dashboard and click on New Tag

2. Under the Tag Configuration, choose Google Analytics: Universal Analytics as the tag type, and Event as the track type. Then fill in the Category, Action, and Label.

3. Then, go to the Google Analytics settings and fill in your Google Analytics tracking code.

4. Next, create a trigger by clicking on the Triggering section under the Tag configuration.

5. Click on the plus sign at the top right corner and then click again on the triggering section. Choose "Event Ready" and click on Save

6. Now, whenever the user visits a survey page and the "Event is ready", this particular event will be fired.

Screenshot 30-09-2024 at 19.17.png

Using GTM debugging tools to see the events pushed to the GTM data layer.

1. Create a GTM workspace, if you haven’t yet. 

2. Open your GTM workspace and click on the Preview button in the top right corner

Screenshot 30-09-2024 at 19.19.png

 

3. In the newly opened tab, enter the survey URL you want to debug and Click on the Start button.

STR.jpeg

4. Your survey will be opened in a new tab with `?gtm_debug=x` appended to the URL. Further, you will see Debugger-connected Dialogue box at the bottom right side of the survey page.

as.png

5. As you start answering the survey questions, various events will be added to the Tag Assistant Page. Some of the actions that GTM tracks in default are when a survey is started, answered, skipped, or submitted. These events were pushed from the SurveySparrow survey to the GTM data layer.

Image

6. Once you have completed addressing the events, disconnect the debugger.

Embedding Custom HTML using GTM

You can embed custom HTML on the survey page with the help of GTM(Google Tag Manager). To embed a small HTML Script via GTM which will run on the survey Page, follow these steps:

1. Create a Survey and integrate it with the GTM.

2. Now navigate to the GTM dashboard and create a new Tag.

3. In the Tag Configuration section, Select Custom HTML.

Image

4. Then add a custom JS snippet alert message as shown below

<script>

alert ("Hello from Google tag Manager")

</script>

5. Create a trigger by clicking on the Triggering section under the Tag configuration. Choose the Page View trigger, so whenever the page is viewed for the first time, the above script will run.

6. Name the Tag and save it.

7. To test it, click on the Preview button on the top right corner of the GTM homepage and proceed with debugging.

8. Once you land on your survey page, you will see the alert that was created.

9. To disable the GTM - SurveySparrow Integration, go back to the Integrate tab, and turn off the integration toggle.

Screenshot 2024-09-30 at 7.22.15 PM.png

That's it! And, that's how the SurveySparrow-Google Tag Manager can be set up and disabled.

Advantages of integrating your Survey with Google Tag Manager

  • Improve the visitor analytics of your survey campaigns with the help of tags
  • Gain deep insights on a wide of range user interactions including form submissions, click events, scroll events, and page visits.

Please reach out to us if you have any questions. We are just a chat away!

Powered By SparrowDesk