Integrate ConvertedIn Pixel using GTM

if you don't have a GTM already setup you can use

Installation

First include the sdk in your website in the last record of the <head> tag

```js
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-P5BMX39V');</script>
    <!-- End Google Tag Manager -->
```

Then before the close tag of <body>

```js
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P5BMX39V"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
```

Send tracking events

All events will be sent through GTM data layer object as shown in the below table.

Event Name
Event Description

PageView

dataLayer.push({
                'event': 'PageView',
                'PageView': true,
            });

ViewContent

dataLayer.push({
                'event': 'ViewContent',
                'ViewContent': true,
                'ViewContentData': {
                    content: [
                        {
                            id: 1234, // required
                            quantity: 3, // required
                            name: "Product name", // optional
                            category: "Product Category", // optional
                        }
                    ],
                    currency: "USD", // required
                    value: 150.50 // required, sum of products price
                }
            });

AddToCart

dataLayer.push({
                'event': 'AddToCart',
                'AddToCart': true,
                'AddToCartData': {
                    content: [
                        {
                            id: 1234, // required
                            quantity: 3, // required
                            name: "Product name", // optional
                            category: "Product Category", // optional
                        }
                    ],
                    currency: "USD", // required
                    value: 150.50 // required, sum of products price
                }
                
            });

InitiateCheckout

dataLayer.push({
                'event': 'InitiateCheckout',
                'InitiateCheckout': true,
                'InitiateCheckoutData': {
                    content: [
                        {
                            id: 1234, // required
                            quantity: 3, // required
                            name: "Product name", // optional
                            category: "Product Category", // optional
                        }
                    ],
                    currency: "USD", // required
                    value: 150.50 // required, sum of products price
                }
                
            });

Purchase

dataLayer.push({
                'event': 'Purchase',
                'Purchase': true,
                'PurchaseData': {
                    content: [
                        {
                            id: 1234, // required
                            quantity: 3, // required
                            name: "Product name", // optional
                            category: "Product Category", // optional
                        }
                    ],
                    currency: "USD", // required
                    order_id: 123,
                    value: 150.50 // required, sum of products price
                }
                
            });                                

Already Got GTM installed

Ask the team for the latest export GTM json including ( Folders, Tags, Varibles, Triggers).

Then continue with your datalayer firing.

Identify Customer

After login, you can assign your customer id in the local storage with a key called ci_cid to ensure the data integrity with the customer journey in your website.

Last updated