Advanced Configuration
This section covers some recommended configurations, is not mandatory to set up all of them.
Internal Promotions
Since there is no promotions module that has the necessary functionalities to track Enhanced Ecommerce, it is necessary to perform a specific integration and configuration in each promotion module.
The first part requires customizing the template in charge of displaying the promotion with a CSS class, in this way the tracking module will be able to detect when the promotion is displayed on the user's screen and the clicks made on the promotion.
The second part is to add some URL parameters in each promotion link, these parameters are the data that will be used to identify the promotion in the tracking reports.
Info
In order to complete this section, it is necessary to have basic knowledge of HTML
Template Customization
Before customizing the template it's recommended to perform an override in the modules folder of your theme, so if there is a new module update, the customizations will not be overwritten.
PrestaShop has a loading system that allows module customization within each theme, so it's possible to custom any module design for any theme.
The modules are installed by default in the folder /modules/module_name
and the templates of a module should be located in /modules/module_name/views/templates
.
The themes, have amodules
folder that contains all modules with their custom templates, PrestaShop will check if exist any template file to override; whether not, will load the original module template. To make an override is required to mirror the module folder structure in modules theme folder.
Example
As example will take the ps_banner
module, that have the templates on the module folder /modules/ps_banner/
will copy the file that renders the promotions ps_banner.tpl
Replicate this folder structure on PrestaShop theme in the following way /themes/theme_name/modules/ps_banner/
and copy the file ps_banner.tpl
to customize it.
Inside the file, look for the a
element and include the class name js-track-promo
to the ancestor element of a
. Whether non exist an ancestor element, will require to create a div
element with the class name js-track-promo
as a wrapper of a
element.
<a class="banner" href="{$banner_link}">
{if isset($banner_img)}
<img src="{$banner_img}" alt="{$banner_desc}" title="{$banner_desc}">
{else}
<span>{$banner_desc}</span>
{/if}
</a>
<div class="js-track-promo">
<a class="banner" href="{$banner_link}">
{if isset($banner_img)}
<img src="{$banner_img}" alt="{$banner_desc}" title="{$banner_desc}">
{else}
<span>{$banner_desc}</span>
{/if}
</a>
</div>
URL Parameters
The module is prepared to read URL parameters on promotion links to generate the view and click event, these parameters should have to be correctly added at URL definition inside module promotion.
Parameters List
Parameter | Description |
---|---|
pid |
Promotion ID |
pnm |
Promotion name |
cnm |
Creativity name |
csl |
Creativity Slot |
ppid |
Promotion product ID |
ppaid |
Promotion product ID attribute |
The first parameter is separated from URL by ? symbol, between parameters are separated by & symbol.
Therefore, before add the promotion parameters, will have to know which separator are required.
https://www.myshop.com/es/5-apparel?pid=id_promo&pnm=apparel_offer&cnm=bycicle_boy&csl=wheel_second_img&ppid=1&ppaid=0
https://www.myshop.com/es/5-apparel?q=size-s&pid=id_promo&pnm=apparel_offer&cnm=bycicle_boy&csl=wheel_second_img&ppid=1&ppaid=0
BigQuery Integration
Follow these instructions to set up BigQuery and link it with GA4 ( https://support.google.com/analytics/answer/9823238 )