Add tracking for Google Tag manager manually.
Here is a snippet of code that will activate the events for Google Tag Manager, and allow you to see successful click submitted from events. If the form field is empty it will not record it as a successful referral.
Useful for the call to action for signing up to a newsletter, demo, or any form of sign up that you want to track where you are collecting information ex email.
Note: This form is not connected to any script to send a message, you will have your own set up for collecting the email address. It is only away to get the click events tracked on your Tag manager.
Google Tag manager successful form submissions
Below is a button with an id of “sendBtn” this will listening for a click event to run the code for the Google Tag Manager.
Will only run the successful click event if the email address has been completed. If it is empty it will not run anything.
You can try it out below, click send, then try when you add in your email.