Complete these prerequisites before implementing dynamic remarketing.

## Install Google tag and remarketing event snippet

Begin by [tagging your site for remarketing](https://support.google.com/google-ads/answer/2476688). You can retrieve the
`global_site_tag` or `event_snippet` from the API by querying the
[`tag_snippets`](https://developers.google.com/google-ads/api/fields/v26/conversion_action#conversion_action.tag_snippets)
field of the [`conversion_action`](https://developers.google.com/google-ads/api/fields/v26/conversion_action) resource (which
returns [`TagSnippet`](https://developers.google.com/google-ads/api/reference/rpc/v26/TagSnippet) objects).

Follow these steps to embed tags in your website manually:

1. **Get the Google tag and the remarketing event snippet.**

   The Google tag sets a cookie on your site that collects information about
   the ad click that brought a visitor to your site and adds website visitors
   to standard remarketing lists in your Google Ads account.

   To make sure the tagging works with dynamic remarketing, select **Collect
   specific attributes or parameters to personalize ads** during the step
   **Create the Google Ads tag data source**:

   ![Screenshot showing the option to collect specific attributes during tag data source creation](https://developers.google.com/static/google-ads/api/images/tag-data-source.png)

   For detailed instructions on acquiring the Google tag and remarketing event
   snippet, see [Tag your website using Google Ads](https://support.google.com/google-ads/answer/2476688).
2. **Install the Google tag.**

   Install the Google tag on all pages of your website that send remarketing
   information. You need only one Google tag for each Google Ads account. The event
   snippet tracks additional actions that are counted as remarketing events.
   Install this snippet on site pages you'd like to track, right after the
   Google tag in the `<head></head>` section.

   The Google tag also works with other tags such as Google Analytics tags. For
   details on how tags work, see the [Google Analytics `gtag.js` developer
   guide](https://developers.google.com/analytics/devguides/collection/gtagjs).
3. **Install an event snippet on site pages you want to track, with
   corresponding custom parameter values.**

   Custom parameters are elements in your remarketing tag code that let your
   tag send information about specific items or selections on your website to
   your Google Ads account. Custom parameters correspond directly to business data
   feeds, where you add the values that match the information the tag collects.

   To use dynamic remarketing, you must include the custom parameters marked as
   `Required` in [Dynamic remarketing events and
   parameters](https://support.google.com/google-ads/answer/7305793).

   When you add the value of a custom parameter to your remarketing tag, it
   syncs with your feed to show the same product or service in your ads
   previously viewed by the same visitor.

   The following example installs an event snippet for a retail site using
   Google Analytics 4 event parameters (where `item_id` is the [Merchant Center
   Product ID](https://support.google.com/merchants/answer/7052112) that corresponds to the product on the
   page):

       gtag('event', 'view_item', {
         currency: 'USD',
         value: 29.99,
         items: [
           {
             item_id: '34592212'
           }
         ]
       });

   For detailed definitions of the parameters and their valid values, see
   [Dynamic remarketing events and parameters](https://support.google.com/google-ads/answer/7305793).

   The event name you use (such as `view_item` in the preceding example) can be
   a custom event name of your choosing or one of the recommended standard
   events. It doesn't need to match any specific value for implementing dynamic
   remarketing, as long as the event data parameters (`items`, `currency`, and
   `value` in this example) are correctly set.

   For detailed documentation on custom parameters for different business types
   and how the Google tag works, refer to [Set up conversion tracking for your
   website](https://support.google.com/google-ads/answer/12216424).

## Connect tag data to your campaigns

The custom parameters you send in the event snippet, especially identifiers
like `item_id`, must match the IDs in the data source you're using for your
dynamic remarketing campaigns in Google Ads.

There are two main types of data sources:

- **Retail:** Uses a product feed from [Google Merchant
  Center](https://support.google.com/merchants/answer/7052112). The `item_id` in the tag must match the Product ID in your Merchant Center feed. The Merchant Center feed is managed within Merchant Center and then linked to your Google Ads account. See the [Merchant Center dynamic remarketing example](https://developers.google.com/google-ads/api/docs/dynamic-remarketing/merchant-center-example).
- **Other business types:** For business types such as flights, hotels, and education, use asset-based feeds managed as [`Asset`](https://developers.google.com/google-ads/api/reference/rpc/v26/Asset) and [`AssetSet`](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetSet) resources using the Google Ads API. The IDs you pass in the tag---such as `item_id`, `origin`, and `destination`---must correspond to the specific identifier fields within your `Asset` data (such as `DynamicEducationAsset.program_id` or `DynamicFlightsAsset.destination_id`) within the `AssetSet`. See [Dynamic
  remarketing with assets](https://developers.google.com/google-ads/api/docs/dynamic-remarketing/asset-based) for details on how to use the API to manage these feeds and map the correct fields for your business type.