Useful scripts for Google Tag Manager

Survey #1

Google Tag Manager can be used to deploy custom surveys on your website.

You can send the results to your Google Analytics account.

Besides the obvious advantage that it is FREE, you can also create remarketing lists based on the results.

If you have client id or user id tracking implemented you can tie answers to users.


Step 1 – Create a Custom HTML tag


Step 2 – Add the following code


You can remove the Jquery library call if you already have it installed.

<script src=””></script>



Step 3 – Replace the question and the answers from the code with your own.

You can remove or add answers but keep the object structure intact.

The survey box will auto-resize to the number of answers you have.



click here  —>  GTMsurvey


When the user clicks “Send”  the answers are pushed to the DataLayer. You can use an event tag to send the answers to Google Analytics.

Google Tag Manager survey





Tiny tweeks may be needed for different platforms.

(ex: WordPress adds an emoji image, that breaks the layout, when it detects the checkmark symbol; the disable emoji plugin is needed).


Next Post

Previous Post

Leave a Reply

© 2021 GTMScripts