Even though you want to track button clicks, you technically track form submissions. Therefore, assign the ID to the entire form, not the button.

The form(s) you want to track must have a unique ID.

Let’s say you have five forms on your entire website. All forms have the ID id=”form”. However, you just want to track one of the forms with Google Tag Manager. In this example, you should rename one of the five forms to a different ID. For example id=”newsletter-form”.

How you assign a unique identifier (ID) for the form(s) you want to track works different for every website. You need to figure out with what tool, for example, a WordPress page builder, your form was created, or if it was programmed manually.

You can check the ID of your form using your browser. It is easiest with Google Chrome. Just right-click on your website. Select Inspect, and click on the icon, marked in the screenshot, and hover over your form. You should then be able to see the ID of your form.

If you can’t find an ID, that means that the form doesn’t have one. If you can find an ID make sure it is unique to the form you want to track.



Source link