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 **
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
<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:
- Click on TEMPLATES: > Generate
- Click on the three dots + import
- 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)
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:
- 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:
- Enter VTEX my apps
- Click on allow custom HTML tags
Implementation of LEAD and ADQ script in Google Tag Manager
To make changes in GTM, you must review the tabs: Variables, Activators and Labels.
- Enter Google Tag Manager
- From the Variables > Configuration tab you must activate/check the click id and click classes variable.
You will see the screen as follows:
Lead Activator
- 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
- 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
- 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.
- Using that code, complete the last part of the trigger, as seen below:
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.
- 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".
- Now go to the Labels tab
- Here you must associate the trigger with the corresponding script.
- Generates a label with a name. For example: icomm_lead.
- Select as tag type Custom HTML
- 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)
- In this case, copy the one from Lead and paste it in the GTM
- Then do the same to associate the Adq script with the Thanks for your purchase trigger.
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
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.
- In GTM, from the General View tab, select the Preview option
- Copy the domain you want to test
- Put the URL corresponding to the site you want to test
- Click on Continue
- A new site window will be displayed
- 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
- Once you remove everything, click Add to cart or buy and check if the tag was implemented correctly
Updated on: 05/31/2023
Thank you!