# Supporting Google Tag Manager conversion tracking

> [!NOTE]
> **Objective:** Implement conversion tracking (Google Analytics) using Google Tag Manager.

> [!NOTE]
> **Note:** The recommended way to [implement conversion tracking is using gtag.js](https://developers.google.com/actions-center/legacy/tutorials/tutorial-ga-based-conversion-tracking). If you are currently using Google Tag Manager (GTM) to manage website tags, you can use this guide to implement conversion tracking.

> [!NOTE]
> **Note:** Please ensure that as part of conversion data, user Personal Identification Information (PII) should not be sent to Google without expressed user consent or as otherwise permitted under law.

### Instructions

There are 2 steps for implementing conversion tracking:

- Create a new Custom HTML Tag
- Create a new Google Analytics: GA4 Event Tag

### Custom HTML Tag

To properly track conversions from `action_link`(s), Google will
set a URL parameter `rwg_token`, which should be returned at the
time of a conversion.

You will be required to persist the `rwg_token` URL parameter
which will be appended to all `action_link`(s) provided by you for
a duration of 30 days when a user visits the landing page via Google. If a
user visits the page through an action link again during the 30 day period,
the existing `rwg_token` should be replaced with a new token, and
the 30 day time to live should be reset. The suggested way to persist this
information is via cookies.

> [!NOTE]
> **Note:** The value of the `rwg_token` should be stored and returned without any edits.

Our recommended approach to persist the `rwg_token` is to create
a custom HTML tag, which is fired on every page view. The custom HTML tag
should contain javascript which extracts the `rwg_token` form the
url parameter and persists the `rwg_token` for 30 days. You can
persist the data using 1st Party Cookies or a Data Layer Variable.

### Google Analytics: GA4 Event Tag

GA4 Event Tag allows you to forward the `rwg_token` to Google
using the correct measurement ID.

When configuring the GA4 Event Tag, you are required to initiate the
following fields:

- **Configuration Tag:** Set this to `None : Manually set ID`.
- **Measurement ID** Set the appropriate Measurement ID for your account.

> [!NOTE]
> **Note:** If you do not have a measurement ID, work with your Google contact to generate one.

- **Event Name** : Set this to `rwg_conversion`
- **Event Parameter** : Add a new Event Parameter `rwg_token`. The value of this token should be the persisted value of the token.

Each GA4 Event Tag needs to be associated with a Trigger. You should create
a trigger which fires this event tag when a user completes a transaction
which originated from a Google Place Action link.