GTM Custom Event Tracking Demo

A live demonstration of tracking a form submission with a custom dataLayer event.

Demo Lead Form

Fill out and submit this form. After submission, a custom event named form_submission_success will be pushed to the dataLayer.

GTM Setup Instructions

Step 1: Create a New Trigger

  1. In your GTM container, navigate to Triggers > New.
  2. Choose the trigger type: Custom Event.
  3. For Event Name, enter: form_submission_success. This must match exactly.
  4. This trigger fires on: All Custom Events.
  5. Name the trigger CE - Form Success and click Save.

Step 2: Create the GA4 Tag

  1. Navigate to Tags > New.
  2. Choose the tag type: Google Analytics > GA4 Event.
  3. Select your existing GA4 Configuration Tag.
  4. For Event Name, enter generate_lead. This is the event name that will appear in your GA4 reports.
  5. Under Triggering, select the trigger you just created: CE - Form Success.
  6. Name the tag GA4 Event - generate_lead and click Save.

Step 3: Test with Preview Mode

  1. Click Preview in GTM and enter this page's URL.
  2. Submit the form on this page.
  3. In the GTM Preview debug window, you will see form_submission_success appear in the event list on the left.
  4. Click on that event, and you should see that your GA4 Event - generate_lead tag has fired successfully.