> This article is for developers who want to move Floodlight tags from a Tag
> Manager web container into a server container.

Server-side Tag Manager allows you to move your Google Floodlight sales and
counter tags from the web page to the server. Moving these tags to the server
will reduce the amount of code you have to run in the page, and helps improve
page load times.

### Before you begin

Before you can move tags into your server, make sure that you have:

- Admin access to Google Tag Manager and Floodlight
- [Set up and installed Google Tag Manager](https://support.google.com/tagmanager/answer/6103696)
- [Set up a server container](https://developers.google.com/tag-manager/serverside/overview)
- Set up the [**Google Analytics: GA4**](https://developers.google.com/tag-platform/tag-manager/server-side/send-data#2-receive-data-in-your-server-side-container) client

## Step 1: Set up the Conversion Linker tag

Your Floodlight account can only send conversion data to Google Tag Manager when
you have set up a **Conversion Linker** tag.

*If you already have a
[Conversion Linker](https://support.google.com/tagmanager/answer/7549390) tag
configured in your server container, you can skip this step.*

To set up the **Conversion Linker** tag:

1. From your server container workspace, open the **Tags** menu on the left side of the page.
2. Click **New** to add a new tag.
3. Select the **Conversion Linker** tag type.
4. Set up the trigger that will cause the **Conversion Linker** server-side tag to fire.   
   *In most cases, the **All pages** trigger is the best option.*
5. Name the tag and click **Save** . ![Conversion Linker tag detail](https://developers.google.com/static/tag-platform/tag-manager/server-side/img/ads-setup/linker_expanded.png)

## Step 2: Set up Floodlight tags

Google Tag Manager supports Floodlight Counter tags and Floodlight Sales tags in
the server container.

### Floodlight Counter

To set up a **Floodlight Counter** tag:

1. In your server container workspace, select the **Tags** menu on the left side of the page.
2. Click **New** to add a new tag.
3. Select the **Floodlight Counter** tag type.

   ![Choose tag type dialog with Floodlight Counter tag
   highlighted](https://developers.google.com/static/tag-platform/tag-manager/server-side/img/fl-setup/floodlight-counter-select.png)
4. To gather the values required for tag configuration, open another
   browser window and sign in to [Campaign Manager 360](https://support.google.com/campaignmanager/answer/2709362).
   Click **Advertisers**, and then click the name of the advertiser.
   Enter these values in your new Tag Manager Floodlight Counter tag:

   - **Advertiser ID** : The Advertiser ID will appear on the advertiser details page just below the advertiser's name. This value is also found as the value of `src=` in a generated Floodlight tag snippet.
   - **Group Tag String** : In the Activity table, identify the activity you want to work with and find the *group tag string* listed in a column to the right. This is also found as the value of `type=` in a generated Floodlight tag snippet.
   - **Activity Tag String** : In the Activity table, identify the activity you want to work with and find the *activity tag
     string* listed in a column to the right. This is also found as the value of `cat=` in a generated Floodlight tag snippet.
5. Set the desired **Counting Method**:

   - **Standard**: Counts every conversion.
   - **Unique**: Counts the first conversion for each unique user during each 24-hour day, from midnight to midnight, Eastern Time (US).
   - **Per session**: Counts one conversion per user per session. Session length is set by the site where the Floodlight tag is deployed.
6. Open the **Choose a trigger** window.

7. In the **Trigger configuration** menu, select a trigger. In most cases,
   the **All Pages** is the best option.

   ![Choose trigger dialog with All pages trigger
   highlighted](https://developers.google.com/static/tag-platform/tag-manager/server-side/img/fl-setup/all-pages.png)
8. Enter a tag name and click **Save**.

   ![Screenshot showing the Floodlight Counter tag name field changed to Floodlight
   Counter tag](https://developers.google.com/static/tag-platform/tag-manager/server-side/img/fl-setup/floodlight-tag.png)

### Floodlight Sales

To set up a **Floodlight Sales** tag:

1. In your server container workspace, select the **Tags** menu on the left side of the page.
2. Click **New** to add a new tag.
3. Select the **Floodlight Sales** tag type. Note: The **Floodlight Sales**
   tag automatically collects the following values automatically from the
   corresponding [ecommerce field](https://developers.google.com/analytics/devguides/collection/ga4/ecommerce):

       *   Order ID (Transaction ID)
       *   Revenue (Value)

4. To gather the values required for tag configuration, open another
   browser window and sign in to [Campaign Manager
   360](https://support.google.com/campaignmanager/answer/2709362). Click
   **Advertisers**, and then click the name of the advertiser. Enter these
   values in your new Tag Manager Floodlight Counter tag:

   - **Advertiser ID** : The Advertiser ID will appear on the advertiser details page just below the advertiser's name. This value is also found as the value of `src=` in a generated Floodlight tag snippet.
   - **Group Tag String** : In the Activity table, identify the activity you want to work with and find the *group tag string* listed in a column to the right. This is also found as the value of `type=` in a generated Floodlight tag snippet.
   - **Activity Tag String** : In the Activity table, identify the activity you want to work with and find the *activity tag
     string* listed in a column to the right. This is also found as the value of `cat=` in a generated Floodlight tag snippet.
5. Set the desired **Counting Method**:

   - **Standard**: Counts every conversion.
   - **Unique**: Counts the first conversion for each unique user during each 24-hour day, from midnight to midnight, Eastern Time (US).
   - **Per session**: Counts one conversion per user per session. Session length is set by the site where the Floodlight tag is deployed.
6. Open the **Choose a trigger** window.

7. In the **Trigger configuration** menu, select a trigger. In most cases,
   the **All Pages** is the best option.

8. Enter a tag name and click **Save**.

## Optional: Set up conversions with cart data

You can configure your Floodlight Sales tag to send conversions with cart data.
Conversions with cart data provide granular details of conversion events at the
SKU level. By sending the Merchant ID, feed label, feed language, and product
data, you can identify which items are selling well and which ones might need
more support.

### Step 1 of 2: Send cart data parameters to the data layer

1. Create a JSON `ecommerce.purchase.products` array. For example:

           'ecommerce':{
           'purchase':{
               'products': [{
                   'id': 'String',
                   'price': 'Floating point',
                   'quantity': Integer,
                   'country': 'String', // Optional
                   'accountId': 'String' // Optional
               },
               {
                   ... // Each SKU (product) in the transaction
                   // is in its own array item.
               }]
           }
           }'

2. Use the [`dataLayer.push`](https://developers.google.com/tag-platform/tag-manager/datalayer)
   method to make the data available in Google Tag Manager's data layer.

### Step 2 of 2: Configure the Floodlight Sales tag

### Event data

1. In your server container, open your Floodlight Sales tag.
2. Under "Product Reporting", select the **Provide product-level sales
   data** checkbox.
3. Select **Event data** from the "Data Source" drop-down. Google Tag Manager will automatically use the data pushed to the data layer in the `ecommerce.purchase.products` array.
4. Click **Save**.

### Custom configuration

1. In your server container, open your Floodlight Sales tag.
2. Under "Product Reporting", select the **Provide product-level sales data** checkbox.
3. Select **Custom configuration** from the "Data Source" drop-down.
4. Select a dynamic variable or manually enter a value on the following fields:
   - **Product Data**: The formatted string containing the product data.
   - **Merchant ID**: The Google Merchant Center ID of the retailer.
   - **Feed Label**: A label identifying the specific feed used within Google Merchant Center.
   - **Feed Language**: The language of the feed, represented using the 2-letter ISO 639-1 code.
5. Click **Save**.

> [!NOTE]
> **Note:** You should meet the [conversions with cart data requirements](https://support.google.com/sa360/answer/9455407) to fully utilize this feature.

## Optional: Set up Enhanced Conversions

*If you don't use Enhanced Conversions, skip ahead to [Validate your
setup](https://developers.google.com/tag-platform/tag-manager/server-side/fl-setup#validate).*

To configure [Enhanced
Conversions](https://support.google.com/google-ads/answer/9888656) follow the
steps below.

### Set up a user-provided data variable

There are 3 ways in which you can implement enhanced conversions in Tag Manager.
You only need to choose one option to collect user-provided data.

|   | **Automatic collection** | **Manual configuration** | **Code configuration** |
|---|---|---|---|
| Collection method | Automatically collects user-provided data based on the code of your website. <br /> If you need control over where to collect inputs, opt for a manual or code setup. | Specify select CSS properties or JavaScript variables to collect user-provided data. <br /> If you need to take control over data formatting and hashing, opt for code configuration. | Add a code snippet on your website that sends hashed customer data for matching. This method is the best choice for maximizing the accuracy of enhanced conversions by letting you send consistently formatted data whenever your conversion tag fires. |
| Complexity | Simple | Medium | Complex |
| Skills | No special skills needed | HTML and CSS | Web development |

### Automatic collection

1. In your web container, open the **Variables** menu.
2. Create a new **User-Defined Variable** of the type **User-Provided Data**.
3. Set the **Type** to **Automatic collection**.
4. Name the variable, for example, `My user-defined data`.
5. Click **Save**.

### Manual configuration

1. In your web container, open the **Variables** menu.
2. Create a new **User-Defined Variable** of the type **User-Provided Data**.
3. Set the **Type** to **Manual configuration**.
4. For the relevant user data field that you would like to provide via enhanced conversions, add a new or existing variable.

   > [!NOTE]
   > **Note:** If you already have variables in your data layer (whether using CSS selectors or other variable types), you can select those instead of creating new variables. If you aren't sure, continue through the instructions. The variables may be hashed or unhashed.

5. To specify an element from the DOM, create a **New Variable \> Variable Configuration \> DOM Element**.

6. Under **Selection Method** , you can either use a **CSS Selector** or **ID**.
   Tip: If your CSS variables change frequently, add an HTML ID to your site and use the ID variable.

7. Enter the CSS selector or ID name. You can leave the Attribute name field blank.

8. Name and **Save** the DOM Element variable. Your screen will then return to the **User-Provided Data** settings.

9. Name the **User-Provided Data** variable, for example, `My user-defined data`.

10. Click **Save**.

### Code configuration

#### Step 1: Identify and define your enhanced conversions variables

You can either send unhashed data, which Google will hash before the data
reaches the servers, or pre-hashed data. If you decide to send pre-hashed data,
please encode the data using hex-encoded SHA256. In either case, provide at
least one of the following fields: email or phone_ number.  

To push **unhashed** data to the data layer:

1. On your website, store user-provided data as key-value pairs in a
   JavaScript variable. For example:

       var leadsUserData = {
         'email': 'name@example.com',
         'phone_number': '+11234567890',
         'address': {
           first_name: 'John',
           last_name: 'Doe',
           street: '123 Lemon',
           city: 'Some city',
           region: 'CA',
           country: 'US',
           postal_code: '12345',
         },
       };

2. Send the user data together with an event using dataLayer.push(). For
   example:

       <script>
         dataLayer.push({
           'event': 'formSubmitted',
           'leadsUserData': {
             'email': 'name@example.com',
             'phone_number': '+11234567890',
             'address': {
                first_name: 'John',
                last_name: 'Doe',
                street: '123 Lemon',
                city: 'Some city',
                region: 'CA',
                country: 'US',
               postal_code: '12345',
              },
            },
         });
       <script>

The variable `leadsUserData` is now available in Google Tag Manager.

To push **pre-hashed** data to the data layer:

1. On your website, hash user-provided using hex-encoded SHA256. The key
   for encoded data needs to start with `sha256_`. For example:

       {'sha256_email_address':await hashEmail(email.trim()),
       }

2. Send the user data together with an event using `dataLayer.push()`. The
   example below shows a data layer implementation that assumes you have
   written a hashing function yourself, which you run asynchronously.

       <script>
         dataLayer.push({
           'event': 'formSubmitted',
           'leadsUserData': {
             'sha256_email_address': await hashEmail(email.trim()),
             'sha256_phone_number': await hashPhoneNumber(phoneNumber),
             'address': {
               sha265_first_name: await hashString(firstname),
               sha256_last_name: await hashString(lastname),
               sha256_street: await hashString(streetAddress),
               postal_code: '12345',
              },
            },
         });
       <script>

The variable `leadsUserData` is now available in Google Tag Manager.

#### Step 2: Create the user-provided data variable

1. In your web container, open the **Variables** menu.
2. Create a new **User-Defined Variable** of the type **User-Provided Data**.
3. Set the **Type** to **Code**.
4. For the relevant user data field you want to provide, click the drop-down menu and select **New Variable**.
5. Under **Choose Variable Type** , select **Data Layer Variable**.
6. In the **Data Layer Variable** , reference your stored user data. For example, `leadsUserData`.
7. Name and **Save** the Data Layer variable. Your screen will then return to the **User-Provided Data** settings.
8. Name the **User-Provided Data** variable, for example, `My user-defined data`.
9. Click **Save**.

### Assign the variable to the Google tag

1. In your web container, open the **Tags** menu.
2. Edit the **Google tag** you use to send data to the tagging server.
3. Under **Configuration settings** , add a new **Configuration parameter** called `user_data`. Set the **Value** to the **User-provided Data** variable, for example, `{{My user-provided data}}`.
4. **Save** your changes. Your tag should look like this:

   ![Screenshot of the final Google tag configuration referencing the user-provided data variable.](https://developers.google.com/static/tag-platform/tag-manager/server-side/img/user-provided-data.png)

### Configure server-side Floodlight tag

In your server container enable Enhanced Conversions by setting up the
Floodlight Sales or Floodlight Counter tag.

> [!NOTE]
> **Note:** The Floodlight tags, when fired, will send all the available conversion data to Google (including any user provided data). If you want to modify or exclude any event parameters before the tag fires, configure and use the proper transformations and attach them to your tag.

![alt_text](https://developers.google.com/static/tag-platform/tag-manager/server-side/img/conversion-tracking-all-events.png)

User-provided data lets you improve the accuracy of your measurement by
sending hashed first-party user-provided data from your website. To implement
this, you need to agree to the user-provided data terms and policies in your
Search Ads 360 account first.

If you want to include user-provided data for [enhanced conversions for web](https://support.google.com/google-ads/answer/9888656), Personally Identifiable
Information (PII) should be sent from the website (client-side container),
which is, in turn, dispatched by server-side container. If you don't want the
PII to be dispatched by a specific tag, use "Transformations" to redact the PII
for the selected tags.

### Optional: Revenue Value

The Floodlight Sales tag uses the event's `value` parameter as the default
amount to calculate revenue. To specify a different basis to calculate the
revenue value, you need to set up a variable to pull data from your database in
and assign it to your Floodlight Sales tag.

> [!NOTE]
> **Note:** The server container encrypts the revenue value to ensure conversion data doesn't get exposed when the server transmits data back to the browser.

To create a new variable:

1. In your server container, open the **Variables** menu.
2. Create a new user-defined variable for the data input. For example, if you want to use a value from a Firestore database, create a {{Firestore Lookup}} variable.
3. Specify the data sources for the variable.
4. Name the variable, for example, "Profit lookup" and **Save** it.

To use the variable in the Floodlight Sales tag:

1. In your server container, open the **Tags** menu.
2. **Edit** the **Floodlight Sales** tag.
3. In the **Unique Parameters** section:

   - For **Data Source** , pick **Custom configuration**.
   - For **Revenue**, select the variable you've created before.
   - For **Order ID**, enter an ID or use a variable to dynamically populate the order ID.

   ![Floodlight Sales Tracking with Revenue
   Value](https://developers.google.com/static/tag-platform/tag-manager/server-side/img/fl-setup/floodlight_revenue.png)
4. **Save** the tag.

### Optional: Custom parameters

You can pass [custom
fields](https://support.google.com/searchads/answer/7566546#custom_fields) from
your web page to the Google Marketing Platform, such as `match_id`.

### Google Tag Manager

To configure custom fields for Floodlight, prepend `x-dc-` to a
parameter name:

1. In your web container, open the **Tags** menu.
2. Edit a GA4 Event tag or create a new one.
3. In **Event Parameters** , add the parameter name. To signal that it goes to
   Floodlight, prepend `x-dc-`. For example, if you would normally send
   `match_id`, change it to `x-dc-match_id`.

   ![Configuration of the dc- parameters in GA4 web tag.](https://developers.google.com/static/tag-platform/tag-manager/server-side/img/fl-setup/floodlight-dc.png "Floodlight Event Parameter in GA4 Event tag")
4. **Save** the tag.

### gtag.js

To configure custom fields for Floodlight, prepend `x-dc-` to the event
parameter name:

      gtag('event', 'purchase', {
          'x-dc-match_id': [MATCH_ID],
          ...
      })

## Step 3: Validate your setup

Once you start sending data with the server container, you can check to see if
it's working properly by following these steps:

1. Open your website.
2. In your Google Tag Manager server container, select **Preview**. Tag Assistant will start and load your server container.
3. The **Tags** tab shows you all tags that have fired. Make sure to check if the tag you configured fired.
4. The **Console** tab shows any errors that occurred during the data transmission to the server container. Check for errors and resolve them.

For more help with debugging Tag Manager containers see [preview and debug help](https://developers.google.com/tag-platform/tag-manager/server-side/debug).

## Next steps

Once your Floodlight tag works as intended, you can remove any equivalent
Floodlight tags in a web container to avoid data duplication.