---
title: "Configuring WebTag Legacy using Google Tag Manager"
date: "2024-11-25T06:40:46+00:00"
summary: "Configure WebTag Legacy in Google Tag Manager with ease. Learn to set up essential tags like Global and Customer Object, plus optional tags for login, logout, product pages, and more. Streamline your CDP integration for enhanced customer data management."
image:
type: "page"
url: "/customer-data-platform/configuring-webtag-legacy-using-google-tag-manager"
id: "b808a4a0-83a7-4cb4-bba8-68342c34a727"
---

This page provides instructions to configure WebTag Legacy using Google Tag Manager (GTM).

Use the following checklist to configure WebTag:

**S.No.**

**Task**

**Description**

1

[Configure the Acquia Global tag (WebTag Legacy)](#configuring-global-tag-webtag-legacy)

CDP - Global is a default essential tag for GTM.

2

[Configure the Acquia Customer Object tag](#configure-customer-object-tag)

CDP - Customer Object is a default essential tag for GTM.

3

[Configure optional tags](#configure-optional-tags-and-variables)

The following are the default primary tags for GTM:

*   [CDP - Login](#cdp-login)
*   [CDP - Logout](#cdp-logout)
*   [CDP - Products Browsed - (PDP - Product Details Page)](#configure-pdp-tag)
*   [CDP - Cart Updated - (PDP - Product Details Page for Add to Cart)](#configure-pdp-add-to-cart-tag)
*   [CDP - Category Browsed - (PLP - Product List Page)](#configure-plp-tag)
*   [CDP - Cart Updated - (PLP Product List Page for Add to Cart)](#configure-plp-add-to-cart-tag)
*   [CDP - Search](#configure-search-tag)
*   [CDP - Checkout](#configure-checkout-tag)

Configuring the Acquia Global tag (WebTag Legacy)[¶](#configuring-the-acquia-global-tag "Permalink to this heading")
--------------------------------------------------------------------------------------------------------------------

CDP uses an encrypted layer with a bcrypt salted key. You must refresh this key daily to access and push payloads to the CDP API. Also, you must add the encrypted layer to the global tag so that it can auto-create the bcrypt key before getting fired daily, each time a customer engages on a webpage where GTM is added.

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - Global_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the Acquia encrypted layer script:
    
        <script>
            var hashes = {"date": "bcrypt", "date"}
        
            var today = new Date().toISOstring().slice(0,10);
        
            var $A1Config = {
                                        key: hashes [today],
                                        tenantId: ADD ID, host: "Acquia API URL"
                                       };
        </script>
        <script>src="https://scripts.agilone.com/latest/a1.js"</script>
        
    
6.  In **Advanced Settings**:
    1.  Set **Tag firing priority** to _20_.
    2.  Set **Tag firing options** to _Once per page_.
7.  In **Tag Sequencing**:
    1.  Select the **Fire a tag before CDP - Global fires** checkbox.
    2.  In **Setup Tag**, select _CDP - Customer Object_ so that the tag fires right before the CDP - Customer Object tag.
8.  Click **Triggering** and set the triggering process to fire the tag at **All Pages** as **Page View**.
9.  Click **Save**.

Configuring the Acquia Customer Object tag[¶](#configuring-the-acquia-customer-object-tag "Permalink to this heading")
----------------------------------------------------------------------------------------------------------------------

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - Customer Object_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the Acquia Customer Object script:
    
        <script>
            var visitor = {"id" : "{{GA - ClientID}}"};
        
            If ("{{GA - Data Layer - User Email}}" != "unknown")
            {
            visitor.email = "{{GA - Data Layer - User Email}}";
            }
        
           var $a1vis = $A1.Customer(visitor);
        </script>
        
    
6.  In **Advanced Settings**:
    1.  Set **Tag firing priority** to _10_.
    2.  Set **Tag firing options** to _Once per page_.
7.  In **Tag Sequencing**:
    1.  Select the **Fire a tag before CDP - Global fires** checkbox.
    2.  In **Setup Tag**, select the following tags so that the tag fires right before these tags:
        *   CDP - Login
        *   CDP - Logout
        *   CDP - PDP
        *   CDP - PDP - Add to Cart
        *   CDP - PLP
        *   CDP - PLP - Add to Cart
        *   CDP - Search
        *   CDP - Checkout
8.  Click **Triggering** and set the triggering process to fire the tag at **All Page Views - Window Loaded** as **Window Loaded**.
9.  Click **Save**.

Configuring optional tags and variables[¶](#configuring-optional-tags-and-variables "Permalink to this heading")
----------------------------------------------------------------------------------------------------------------

### Configuring CDP - Login¶

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - Login_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the Login script:
    
        <script>
           var $a1event = {type: "Login", customer: $a1vis};
        
           $A1.Event($a1event).send();
        </script>
        
    
6.  In **Advanced Settings**, set **Tag firing priority** to _10_.
7.  Click **Triggering** and set the triggering process to fire the tag at **User Logged In - Window Loaded** as **Window Loaded**.
8.  Click **Save**.

### Configuring CDP - Logout

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - Login_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the Logout script:
    
        <script>
           var $a1event = {type: "Logout", customer: $a1vis};
           $A1.Event($a1event).send();
        </script>
    
6.  In **Advanced Settings**, set **Tag firing priority** to _10_.
7.  Click **Triggering** and set the triggering process to fire the tag at **User Logged In - Window Loaded** as **Window Loaded**.
8.  Click **Save**.

### Configuring CDP - PDP[¶](#cdp-pdp "Permalink to this heading")

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - PDP_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the PDP script:
    
        <script>
           var $a1prod = {productId: "{{PDP - Product SKU - JS}}"};
           var $a1event = {type: "productBrowsed", customer: $a1vis, targets: $a1prod};
        
           $A1.Event($a1event).send();
        </script>
        
    
6.  Click **Triggering** and set the triggering process to fire the tag at **PDP - Window Loaded** as **Window Loaded**.
7.  Click **Save**.

### Configuring CDP - PDP - Add to Cart[¶](#cdp-pdp-add-to-cart "Permalink to this heading")

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - PDP - Add to Cart_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the PDP - Add to Cart script:
    
        <script>
           var $a1prod = {productId: "{{PDP - Product SKU - JS}}"};
           var $a1event = $a1event({type: "cartUpdated", customer: $a1vis, targets: $a1prod});
        
           $a1event.send();
        </script>
        
    
6.  Click **Triggering** and set the triggering process to fire the tag at **PDP - Add to Cart** as **All Elements**.
7.  Click **Save**.

### Configuring CDP - PLP[¶](#cdp-plp "Permalink to this heading")

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - PLP_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the PLP script:
    
        <script>
            var $a1cat = {SourceProductCategoryNumber: "{{Page Path}}"};
            var $a1event = {type: "categoryBrowsed", customer: $a1vis, targets: $a1cat};
        
            $A1.Event($a1event).send();
        </script>
        
    
6.  Click **Triggering** and set the triggering process to fire the tag at **View Category - Window Loaded** as **Window Loaded**.
7.  Click **Save**.

### Configuring CDP - PLP - Add to Cart[¶](#cdp-plp-add-to-cart "Permalink to this heading")

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - PLP - Add to Cart_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the PLP - Add to Cart script:
    
        <script>
           var $a1prod = {productID: "{{PLP - Quick Shop Opened - Product SKU - JS}}"};
           var $a1event = {type: "cartUpdated", customer: $a1vis, targets: $a1prod};
        
           $A1.Event($a1event).send();
        </script>
        
    
6.  Click **Triggering** and set the triggering process to fire the tag at **PLP - Quickshop - Add To Cart** as **All Elements**.
7.  Click **Save**.

### Configuring CDP - Search[¶](#cdp-search "Permalink to this heading")

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - Search_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the CDP - Search script.
    
        <script>
            var $a1search = {terms: "{{Site Search Term}}"};
            var $a1event = {type: "onsiteSearch", customer: "Login", customer: $a1vis, targets: $a1search};
        
            $A1.Event($a1event).send();
        </script>
        
    
6.  Click **Triggering** and set the triggering process to fire the tag at **Search Page - Window Loaded** as **Window Loaded**.
7.  Click **Save**.

### Configuring CDP - Checkout[¶](#cdp-checkout "Permalink to this heading")

1.  In the GTM user interface, click **Tags** > **New**.
2.  Name the tag as _CDP - Checkout_.
3.  Click **Tag Configuration**.
4.  In **Choose tag type**, click **Custom HTML**.
5.  In **HTML**, create the CDP - Checkout script.
    
        <script>
        (function(){
         var _ix = { };
          _ix.order = dataLayer[0];
          _ix.orderId = _ix.order.transactionId;
          _ix.total = _ix.order.transactionSubtotal;
          _ix.price = [ ];
          _ix.skus = [ ];
          _ix.quantity = [ ];
          _ix.items = [ ];
           for(var x in _ix.order.transactionProducts){
            _ix.items.push({
             id: _ix.orderId + "-" + (x + 1),
             type: "Purchase",
             subType: "pending",
             productId: _ix.order.transactionProducts [x].sku,
             quantity _ix.order.transactionProducts[x].quantity,
             saleRevenue: _ix.order.transactionProducts[x]. Price *
          _ix.order.transactionProducts[x] . quantity,
             discount: 0
            });
        
         }
         var $tx = {id: _ix.orderId, type: "Purchase"};
        
         var $a1event = {
             type: "checkout",
             customer: $a1vis,
             transaction: $tx,
             targets: _ix.items};
        
          // $A1.Event($a1event).send();
         })()
        </script>
        
    
6.  Click **Triggering** and set the triggering process to fire the tag at **Checkout - Confirmation Page** as **Dom Ready**.
7.  Click **Save**.