Home Integrations How to trigger conversions in GTM for specific fields or custom rules (e.g., Email Field or Score)

How to trigger conversions in GTM for specific fields or custom rules (e.g., Email Field or Score)

Last updated on Mar 11, 2026

When you integrate Yay! Forms with Google Tag Manager (GTM), our platform automatically sends the submission data to your website's Data Layer (dataLayer).

By default, Yay! Forms fires events like YFAnswer every time a user answers a question. However, in many cases, you might want to fire a conversion tag (Google Ads, Meta Pixel, etc.) only when a specific field is filled out — such as the Email field — or when the user reaches a minimum score.

In this tutorial, we'll use the Email field submission as an example, but you'll learn the logic to apply to any other criteria!

Step 1: Find the desired field ID

To ensure your setup doesn't break if you change the question title in the future, the best practice is to use the field ID (fieldId) as a rule, rather than the question text.

  1. Open the Preview mode of your GTM.

  2. Go to the page where your form is published and fill in the test field (e.g., your email) to proceed.

  3. In the GTM Preview window, look in the left sidebar for the YFAnswer event that was just fired.

  4. Click on the Data Layer tab.

  5. Look for the data.fieldId property and copy the code that appears in quotes (it will be a sequence of letters and numbers, like 661071860811e305370cadb8).

Step 2: Create a Data Layer Variable in GTM

Now, we need to "teach" GTM to read this ID information dynamically.

  1. In your GTM dashboard, go to Variables and click New (under User-Defined Variables).

  2. Click on Variable Configuration and choose the Data Layer Variable type.

  3. In the Data Layer Variable Name field, type the exact property path: data.fieldId

  4. Give it an easy-to-identify name, such as DLV - Field ID, and click Save.

Step 3: Create the Conversion Trigger

Now let's create the exact rule: GTM will only fire the tag when the event is an answer (YFAnswer) AND the field ID matches the email field.

  1. Go to the Triggers sidebar menu and click New.

  2. Click on Trigger Configuration and choose Custom Event.

  3. In the Event name field, type: YFAnswer

  4. Under "This trigger fires on", select the Some Custom Events option.

  5. Set up the firing rule by selecting the variable you created in Step 2:

    • Choose: [DLV - Field ID]

    • Condition: equals

    • Value: Paste the ID code you copied in Step 1.

  6. Give it a name (e.g., Trigger - Email Answer) and click Save.

Step 4: Add the Trigger to your Tag

Done! Now just go to your Conversion Tag (Google Ads, Meta, Analytics, etc.), scroll down to the Triggering section, and select the Trigger you just created. Save and publish the changes in your GTM.


Going further: Using other rules (e.g., Score)

You are not limited only to field IDs. The payload (data package) that Yay! Forms sends to the dataLayer is very rich.

For example, if your form has a logical calculator and you only want to fire a conversion if the user's Score is greater than 100, you can follow the same logic:

  1. Create the Variable: GTM needs to read the score. Create a Data Layer Variable named: data.variables.score

  2. Create the Trigger: Create a Custom Event for the final submission moment (YFSubmit).

  3. Set the Rule: Adjust it to fire only when your new variable is greater than 100.

You can explore the GTM Preview to see all the data we send inside the data property (like UTMs, hidden fields, and more) and create highly segmented triggers for your campaigns!