GA4 Custom Events & Parameters Using Data Layers

ListenLayer automatically generates powerful data layers to enhance your Google Analytics tracking. Check out the samples below and open a free account.

GA4 Data Layer Examples

Google Analytics is powerful out of the box, but it’s much more powerful when you begin to send custom events, parameters, and user properties based on your website activity. ListenLayer automates this by making data available in the data layer.

 

Important Notice!

While the following examples show actual code, ListenLayer requires no programming experience! We generate the following data layer values automatically so that you can capture them as variables for your conversion tracking - no coding required! Check out our examples and use cases to see how easy it is to implement and scale conversion tracking and web analytics.

Custom Triggers for Events with Parameters

ListenLayer automatically generates powerful and accurate events inside the data layer, allowing you to create GTM triggers by simply referencing the event name.  Once these triggers are built, simple event tags in GTM can send events, parameters, and user properties to GA4.

This example shows events from our Gravity Forms Listener. Each Listener generates events unique to the application’s functionality.

event: 'gfFormSubmitted',

event: 'gfFormLoaded',

event: 'gfFormValidationFailed',

Automatic Data Layer Values

With each event generated by ListenLayer, we push powerful details about the user’s session and activity into the data layer. These become available as variables inside GTM.

Use these variables to modify triggers in GTM or enhance the data you collect using GA4’s powerful event and conversion structure.

event: 'gfFormStepChange',
  formAutomaticValues: {
    formID: '#gform_3',
    formFieldValues: {
      input_2: {
        id: 'input_3_2',
        label: 'Are you ready?',
        name: 'input_2',
        type: 'select-one',
        value: 'First Choice'
      },
    },
    formLocation: {
      href: 'https://demo.hostedstaging.com/gravity-step-form/',
      host: 'demo.hostedstaging.com',
      hostname: 'demo.hostedstaging.com',
      pathname: '/gravity-step-form/',
      protocol: 'https:',
      originPathName: 'https://demo.hostedstaging.com/gravity-step-form/'
    },
    stepNumberCompleted: 4,
    stepNumberStart: 5,
    stepFinal: false
  }

Custom Data Layer Values in GTM

With our powerful interface, marketers can write rules to generate custom data layer values – no programming required!

Now activity on your website can be categorized and organized exactly how you want it. Push these values into GTM as custom variables and then feed them into Google Analytics 4 using events, parameters, and user properties.

formCustomValues: {
	//custom variable values display here based on rules you write
	formCategory: 'Demo',
	formName: 'MultiStep Form',
	formQuality: 'Low'
},