> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.icommkt.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to activate Scripts Lead & ADQ

Learn the steps to activate the Lead and Acq scripts in the Results dashboard. Also learn [how to generate the templates in Google Tag Manager for users with VTEX IO](https://help.icommkt.com/en/article/how-to-activate-lead-and-adq-1drsa3b/?bust=1678122561102#1 -templates-from-gtm-for-vtex-io).

# Lead Generation or Acquisition from a website

The imputation of a Lead or Acquisition from an external website occurs through the invocation of the following script:

**LEAD**: This request must be made when the event occurs that guarantees the occurrence of the action related to the Lead (for example, after a user registers in a form or clicks on add to cart).

**ADQ**: This request must be made at the time of the occurrence of the event that guarantees the occurrence of the action related to the Adq (for example when the "Thank you for your purchase" appears)

### How to get the script

* Go to the **Settings** menu 
* Select the option ** MY ACCOUNT **

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/1_sxemtu.jpg)

### Configurable Script Parameters:

**Variable _imMktOptions:**

a) (Optional) **_itemsQuantity**: Quantity of items in the transaction (Numeric value. Use point as decimal separator)
b) (Optional)** _amount**: Amount of the transaction (Numeric value. Use point as decimal separator)
c) (Optional) **_extraInfo**: Additional information up to 255 characters

###### Example with optional parameters

```javascript
<script language="javascript" type="text/javascript">
var _imMktOptions = _imMktOptions || {_setType: 'Lead', _setDomain: 'DOMAIN',_itemsQuantity: 2,_amount:1000,_extraInfo:
'Shampoo|Soap'};
(function() {
var icomMkt = document.createElement('script'); icomMkt.type = 'text/javascript'; icomMkt.async = true;
icomMkt.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +

'externalassets.icommarketing.com/icomMkt_tracking_jquery.min.js';

var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(icomMkt, s);
})();
</script>
```

# Templates from GTM for VTEX IO

To generate templates from Google Tag Manager for VTEX IO:

1. Click on **TEMPLATES:** > **Generate**
2. Click on the **three dots** + **import**
3. Import the **tpl file and save:

* [ICOMM WebPush Invoke Script.tpl](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/54da0bba-164f-484e-bf21-2a437c11778c/ICOMM_WebPush_Invoke_Script.tpl?X- Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20230306%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=2 0230306T184516Z&X-Amz-Expires=86400&X- Amz-Signature=1e544e0d97b604438afa35fda8a51cdda87a8132121be4eeaffa385f811cb06c&X-Amz-SignedHeaders=host&response-content-disposition=filename%3D%22ICOMM%2520WebPush%2520Invoke% 2520Script.tpl%22&x-id=GetObject)
* [ICOMM Conversion Script (1).tpl](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/a98a174a-e40c-4578-90ab-78c906a17152/ICOMM_Conversion_Script_%281% 29.tpl?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20230306%2Fus-west-2%2Fs3%2Faws4_request& X-Amz-Date=20230306T184538Z&X- Amz-Expires=86400&X-Amz-Signature=c5e12765865eca5a479d1c84f93021418ea2a9236d4e6683ad118cc13443830e&X-Amz-SignedHeaders=host&response-content-disposition=filename%3D%22ICOMM %2520Conversion%2520Script%2520%281%29.tpl%22&x-id=GetObject)

|| Select Conversion Script to implement Lead and Adq
|| Select Webpush Invoke Script to implement Notifications Hub

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-1_tm3n27.png)

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-2_hao2bg.png)

Once the templates are generated you must generate the tags as always, but instead of Custom HTML, select the new ICOMM template.

###### LEAD AND ADQ

* Select Lead or Adq and place the Icomm domain
* Attach triggers and tags to the template
* Submit changes

###### NOTIFICATION HUB

* Select the template and edit the ID (of the client)

**How ​​is it obtained?**

From the .txt script provided by Icomm when registering the module:

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-3_1a3inig.png)
|| In red it is shown where we must place the PUSH client ID

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-4_7h1m1p.png)
|| Here is the push ID in the .txt script

* The HUB activator must be in **All Pager / Todas las paginas**
* Submit changes

# Activate the TAGS

Once the previous steps have been carried out, it is necessary to activate the html TAGS

**Step by Step:**

1. Enter VTEX my apps
2. Click on allow custom HTML tags

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-5_12wvj93.png)

# Implementation of LEAD and ADQ script in Google Tag Manager

To make changes in GTM, you must review the tabs: **Variables, Activators and Labels.**

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-1_sv98ry.png)

1. Enter Google Tag Manager

2. From the **Variables > Configuration** tab you must activate/check the **click id** and **click classes** variable.

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-2_14fhii5.png)

_You will see the screen as follows:_

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-3_1g5q74i.png)


### Lead Activator

1. Go to the **Activators** tab > **New** (place a name that refers to the **add to cart** action).

* In **trigger type** select: Click- all elements.

* On **this trigger fires on**: A few clicks

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-4_xcaay5.png)

2. In order to complete the setup of this activator, please go to the brand website.

* Enter any product, left click on the **add to cart** button and select the **inspect** option

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-5_x29vnj.png)

* In this way you will have access to the front end of the store and you will see an ID code above what is highlighted in light blue.

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-6_wtzxoq.png)

3. Using that code, complete the last part of the trigger, as seen below:

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-7_llvbb4.png)

  _This way the first activator will be ready_

### ADQ Trigger

The second trigger will be for the acquisition action, that is, when the users have completed the purchase.

1. Go to **Triggers > New** (choose a name related to the ADQ)

* In **trigger type** select: Page view

* On **this trigger fires on**: Some pageviews

* In **run this trigger when an event occurs and all of these conditions are met**: URL - Contains - The URL that customers gave us "thank you for your purchase".

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-8_6ppkd6.png)

2. Now go to the **Labels** tab
* Here you must associate the trigger with the corresponding script.

3. Generates a label with a name. For example: icomm_lead.
* Select as tag type **Custom HTML**

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-9_vdybd2.png)

4. In the label configuration paste the icomm script corresponding to the lead and in the activation select the add to cart activator.

###### How to get the script?

From the ICOMM platform: **Settings > My account > Scripts > Lead or Adq** (here you will see scripts in different tabs)

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/1_1crq4gt.jpg)

5. In this case, copy the one from Lead and paste it in the GTM

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-11_dqpyke.png)

6. Then do the same to associate the Adq script with the Thanks for your purchase trigger.

|| Always remember to select **SEND** ​​for the modifications to take effect.

### Test Send

To make a test shipment, you must add a product to the cart (always from the newsletter) and carry out the purchase process (from the newsletter) to check that they are counting correctly.

To check if the labels are correctly placed, you must click on **PREVIEW**

|| With the Google extension: "Tag Assistant", you can check whether the website is associated with the corresponding GTM.

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-12_c7n9mc.png)


# Testing of Lead tags in GTM

With this step by step you can test that the Lead tag created in Google Tag Manager is implemented correctly.

1. In **GTM**, from the **General View** tab, select the **Preview** option

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-1_jrl0tx.png)

2. Copy the domain you want to test

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-2_trrgzs.png)

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-3_9aza6w.png)

3. Put the URL corresponding to the site you want to test

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-4_w93fcp.png)

4. Click on **Continue**

* A new site window will be displayed

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-5_1yaellz.png)

5. Look for some products to test

* Before clicking on **Add to cart or buy**, make sure you remove all the information that is in it from the basket

![](https://storage.crisp.chat/users/helpdesk/website/e4b41ef8ae96c800/untitled-6_1kt2yrl.png)

6. Once you remove everything, click **Add to cart or buy** and check if the tag was implemented correctly

||| If the tag is at the top of the fired tags, it is because it was implemented correctly. In the case that appears at the bottom (in non-activated labels) it means that there is an error.