# Google Ads (gtag.js) Web Device Mode Integration


This guide will help you send conversion events to Google Ads in the [web device mode]({{< ref "destinations/rudderstack-connection-modes.md#device-mode" >}}).

{{< info >}}
This integration leverages the [`gtag.js`](https://developers.google.com/tag-platform/gtagjs) global site tag - a JavaScript tagging framework that lets you send your event data to Google Ads.
{{< /info >}}

## Identify

{{< warning >}}
Before sending the `identify` events to Google Ads, make sure to:
- Set up and enable [enhanced conversions for web](https://support.google.com/google-ads/answer/13258081#zippy=%2Cvalidate-your-implementation-using-chrome-developer-tools%2Cfind-enhanced-conversions-fields-on-your-conversion-page).
- Turn on the **Allow identify calls for the Google Ads destination** [connection setting]({{< ref "destinations/streaming-destinations/google-ads/setup-guide.md#connection-settings" >}}) in the RudderStack dashboard.
{{< /warning >}}

Use the [`identify`]({{< ref "event-spec/standard-events/identify.md" >}}) call to send `user_data` to Google Ads for [enhanced conversions](https://support.google.com/google-ads/answer/9888656).

A sample `identify` call is shown:

```javascript
rudderanalytics.identify("1hKOmRA4GRlm", {
  firstName: "Alex",
  lastName: "Keener",
  email: "alex@example.com",
  phone: "(800) 555‑0175",
})
```

## Track

{{< warning >}}
This destination does not strictly adhere to the [RudderStack Ecommerce Event Spec]({{< ref "event-spec/ecommerce-events-spec/" >}}).
{{< /warning >}}

You can send a [`track`]({{< ref "event-spec/standard-events/track.md" >}}) call with the conversion name and specify it in the **Click Event Conversion** [dashboard setting]({{< ref "destinations/streaming-destinations/google-ads/setup-guide.md#click-event-conversion-settings" >}}). RudderStack, in turn, sends this data to Google Ads.

RudderStack maps `properties.currency`, `properties.order_id`, and `properties.revenue` in the event to Google Ads' `currency`, `transaction_id`, and `value` fields respectively.  Note that this is applicable only when the **Track Dynamic Remarketing** [dashboard setting]({{< ref "destinations/streaming-destinations/google-ads/setup-guide.md#track-event-settings" >}}) is turned off.

A sample `track` call is as shown:

```javascript
rudderanalytics.track('track conversion', {
  revenue: 125,
  currency: 'INR',
  order_id: 'order_1'
});
```

A sample `track` call after turning on the **Track Dynamic Remarketing** setting in the dashboard is shown below:

```javascript
rudderanalytics.track('view_item', {
  'value': 998.55,
  'items': [{
      'id': 1234,
      'google_business_vertical': 'retail'
    },
    {
      'id': 45678,
      'google_business_vertical': 'retail'
    }
  ]
});
```

{{< info >}}
The format for passing the parameters is quite flexible. You can use the standard Google format for tracking specific categories or use your own format for tracking custom categories.
{{< /info >}}

A sample `track` call for a custom event is shown below:

```javascript
rudderanalytics.track("custom_event", {
  custom_parameter1: "1",
  custom_parameter2: 2,
});
```

### Set up new customer acquisition reporting

RudderStack supports sending a `newCustomer` property in your `track` events to determine whether a converting user is a new customer in your Google Ads campaign. This is helpful in [setting up new customer acquisition reporting](https://support.google.com/google-ads/answer/12077475?hl=en#zippy=%2Cinstall-with-the-global-site-tag%2Cinstall-with-google-tag-manager) in Google Ads.

{{< warning >}}
Do not pass the `newCustomer` property if you are unsure about the converting the user status (applicable for new and  existing customers).
{{< /warning >}}

A sample `track` call highlighting this feature is shown:

```javascript
rudderanalytics.track('Order Completed', {
  'newCustomer': false,
  'currency': 'USD',
  'price': 43.99,
  'transaction_id': 'A122311',
  "checkout_id": "CHK1044",
  "revenue": 47.99,
  "products": [{
    "product_id": "A1223",
    "name": "car"
  }]
});
```

## Page

You can make a [`page`]({{< ref "event-spec/standard-events/page.md" >}}) call with the conversion name to RudderStack for a page load conversion. RudderStack, in turn, sends this data to Google Ads.

A sample `page` call is as shown below:

```javascript
rudderanalytics.page('page view');
```

You can turn on **Track Dynamic Remarketing** [dashboard setting]({{< ref "destinations/streaming-destinations/google-ads/setup-guide.md#track-event-settings" >}}) to send custom parameters in the `page` call:

```javascript
rudderanalytics.page("custom_event", {
  custom_parameter1: "Sample",
  custom_parameter2: 2,
});
```

<br />
