Articles on: Developers

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.

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
ICOMM Conversion Script (1).tpl

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





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:


In red it is shown where we must place the PUSH client ID


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:

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.

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.




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

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.

Updated on: 05/31/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!