Describe how to configure a custom event trigger that fires only when a specific parameter within a pushed data layer event matches a particular regular expression.
To configure a custom event trigger in Google Tag Manager (GTM) that fires only when a specific parameter within a pushed data layer event matches a particular regular expression, follow these steps: First, create a new trigger in GTM and select 'Custom Event' as the trigger type. Enter the name of the event that is pushed to the data layer. This is the 'event' value in the `dataLayer.push()` call. For example, if the data layer event is `dataLayer.push({'event': 'formSubmit', 'formID': 'contactForm'})`, you would enter 'formSubmit' as the event name. Next, add a condition to the trigger that checks if the specific parameter matches the regular expression. Click 'Add Filter' to add a new condition. Select a data layer variable that corresponds to the parameter you want to check. If the parameter is nested within a data layer object, use dot notation to access it. For example, if the data layer event is `dataLayer.push({'event': 'productView', 'product': {'productID': '12345'}})`, you would create a data layer variable named 'productID' with the Data Layer Variable Name 'product.productID'. In the condition configuration, select 'matches RegEx' as the operator. Enter the regular expression that you want to match against the parameter value. Ensure that the regular expression is valid and correctly matches the desired pattern. If the regular expression contains special characters, escape them properly. For example, if you want to match any `formID` that starts with 'contact', the regular expression would be '^contact.*$'. Enable the 'Enable capture group and replace functionality' option if you need to use capture groups in the regular expression. This option allows you to extract portions of the matched string and use them in other tags or variables. If you only need the trigger to fire when there is an exact match, disable 'Enable capture group and replace functionality' and add the `$` to the end of the string. Save the trigger. Once the trigger is configured, you can attach it to the tags that you want to fire when the event and the regular expression condition are met. For example, you might attach the trigger to a Google Analytics event tag to track form submissions with specific form IDs. Test the trigger in GTM's preview mode to ensure that it fires correctly when the data layer event is pushed and the parameter matches the regular expression.