Introduction
Now that the core setup is in place, let's add an additional section on capturing custom event parameters in Google Tag Manager and forwarding them to Google Analytics. We will focus on the new_patient parameter (which is a boolean flag) as an example, and format its value as a more readable string ("Yes"/"No") for Analytics. The same technique can be applied to any other custom parameters you want to track.
How to Capture and Send the new_patient Parameter:
1. Create a Data Layer Variable for the Parameter:
In your GTM container, go to Variables and click New to create a user-defined variable. Choose Data Layer Variable as the variable type. Enter the Data Layer Variable Name exactly as it appears in your data layer push (in this case, "new_patient"). This will capture the boolean value (true/false) from the data layer whenever the event occurs. For easier interpretation in Analytics, we can convert this into a human-readable string ("Yes" or "No") by formatting the value using the convenient “Format Value” Settings. Select “Convert true to…” and input Yes. Likewise select “Convert false to..” and input No. Save the variable (e.g., name it DLV – new_patient for clarity).
Screenshot: Configuring a Data Layer Variable for the new_patient parameter in GTM.
2. Pass the Parameter to Google Analytics:
Next, include this parameter in the GA tag so that it gets sent along with your event hits. Open your GA4 Event Tag in GTM (or create a new GA4 Event tag if you haven’t already). In the tag configuration, find the Event Parameters section and click Add Parameter. In the Parameter Name field, enter new_patient (this will be the key that shows up in Analytics). In the Value field, insert the variable that holds the Yes/No value – i.e., choose the Data Layer variable from step 1. This mapping tells GTM to send an event parameter named "new_patient" with each event, using the value of our variable (e.g., "Yes" or "No").
Screenshot: Adding a custom event parameter in a GA4 Event tag. Here, a parameter (new_patient) is being added; you would also use new_patient as the name and select your DLV - new_patient variable as the value.
3. Save and Publish:
After configuring the tag, save your changes. Use GTM Preview and Debug mode to test that everything is working correctly – trigger the relevant event on your site and verify in the GTM debug panel that the new_patient variable is pulling in the correct value and that your GA4 Event tag is firing with the parameter attached. Once confirmed, publish your container to make the changes live.
Verify in Google Analytics:
When the above is set up, your events sent to GA4 will include the new_patient parameter. To pick up this parameter in Analytics reports, you should create a corresponding custom dimension in GA4 (since GA4 only automatically surfaces some parameters, and custom ones need registration to be visible in standard reports). In Google Analytics, go to Admin > Custom Definitions > Create Custom Dimension. Choose an Event-scoped custom dimension and enter the exact parameter name (new_patient) as the Event Parameter name, with an appropriate display name (e.g. "New Patient"). Once this custom dimension is created and data starts flowing, you will be able to use it in GA4 reports and see values like "Yes" and "No" for the new_patient flag (which is much more readable than a raw true/false).
Note: We focused on the new_patient boolean parameter, but you can apply the same approach for other parameters. Simply push them to the data layer on events, create corresponding Data Layer Variables in GTM, transform the values if needed (e.g. format booleans or codes into human-friendly strings), and add them as event parameters in your GA4 tags. By doing so, you enrich your Analytics events with additional context, and with the proper custom dimensions set up in GA4, you’ll be able to analyze those parameters (e.g., segmenting events by new_patient = "Yes" vs "No", or any other custom info you send). This technique ensures your boolean flags and other custom data are captured and reported in a clear, actionable way.