Google Ads Remarketing Setup Using GTM and GA4

Send Custom Events from Data Layer → GTM → GA4 → Google Ads Audience 

Step 1: Push Custom Event to Data Layer (Coding)

When a user performs an action (example: submits a form), push an event to the data layer.

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

  event: "form_submitted",

  formId: "atf",

  pathname: " /services/waste-removal/furniture-removal",
  serviceName: “Furniture Removal”,

  category: "general" 

});

You can send any custom variables you need:

  • event
  • formId
  • pathname
  • serviceName
  • buttonId

Step 2: Create Data Layer Variables in GTM

In GTM:

Variables → New: Create one variable for each value.

Example: 

Variable Name Data Layer Variable Name

DLV - formId         formId
DLV - pathname pathname
DLV - serviceName serviceName

Save each variable.

Step 3: Create a Custom Event Trigger

Go to: Triggers → New

Choose: Custom Event Event Name: form_submitted, button_clicked, page_loaded, etc..

Trigger: All Custom Events

Save.

Step 4: Configure the GA4 Event Tag

Go to: Tags → New

Choose: Google Analytics: GA4 Event Select your existing GA4 Configuration Tag.

Event Name: form_submitted

Add Event Parameters:

Example:

Parameter Name Value

formId                     {{DLV - formId}}
pathname               {{DLV - pathname}}
serviceName          {DLV - serviceName}}

Trigger: form_submitted

Save.

Step 5: Publish GTM

Click: Submit

Publish your GTM container

Step 6: Verify the Event in GA4

Open: GA4 → Admin → DebugView
Perform the action(atf form submission) on your website.

You should see: Event: form_submitted

Parameters:

formId = atf
pathname = /services/waste-removal/furniture-removal
serviceName= Furniture Removal

If everything appears, GTM is correctly sending data to GA4.

Note: You need to test it in GTM Preview mode. Only then will GA4 DebugView work. (or) test it in Reports -> Realtime pages


Step 7: Register Custom Dimensions (Recommended)

If you want to use parameters like pathname or category in reports and audience conditions:

Go to: GA4 → Admin → Custom Definitions

Create a custom dimension for each parameter.

Example:

Dimension Name Event Parameter
Path Name          pathname
Form Id         formId
Button Id         buttonId

Wait up to 24 hours for them to become available in GA4.

Step 8: Link GA4 to Google Ads

In GA4: Admin → Product Links → Google Ads Links

  • Select your Google Ads account.
  • Enable personalized advertising.
  • Save.

Step 9: Create a GA4 Audience

Go to: GA4 → Admin → Audiences → New Audience Example audience: Furniture Removal Page Visitors Who Submitted Form

Conditions: event_name = form_submitted AND pathname = /services/waste-removal/furniture-removal

Save the audience.

Step 10: Wait for Audience Population

GA4 will begin adding users to the audience as they meet the conditions.

This may take several hours to 24 hours, depending on traffic.

Step 11: Use the Audience in Google Ads

Open: Google Ads → Campaign → Audience Segments

Select: Your Data Choose the audience you created in GA4.

Example: Furniture Removal Page Visitors Who Submitted Form

Apply it to your campaign or ad group.

Why are we using this method?

Passing events to google ads


Thank You!