Skip to content

Commit

Permalink
Add product view tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael committed Jun 5, 2024
1 parent ed30e79 commit db1bd20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ecomailemailmarketing/ecomailemailmarketing.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct()
$this->module_key = '3c90ebaffe6722aece11c7a66bc18bec';
$this->name = 'ecomailemailmarketing';
$this->tab = 'emailing';
$this->version = '2.0.14';
$this->version = '2.0.15';
$this->author = 'Ecomail';
$this->need_instance = 0;
$this->ps_versions_compliancy = ['min' => '1.7.0.0', 'max' => _PS_VERSION_];
Expand Down Expand Up @@ -773,6 +773,7 @@ public function hookDisplayFooter(array $params): string
'ECOMAIL_FORM_ID' => Configuration::get('ECOMAIL_FORM_ID'),
'ECOMAIL_FORM_ACCOUNT' => Configuration::get('ECOMAIL_FORM_ACCOUNT'),
'EMAIL' => $this->context->cookie->email ?? 'empty',
'PRODUCT_ID' => Tools::getValue('id_product') ?? false,
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
window.ecotrack('setUserIdFromLocation', 'ecmid');
}
window.ecotrack('trackPageView');
if ({$PRODUCT_ID|escape:'javascript':'UTF-8'}){
window.ecotrack('trackStructEvent', 'ECM_PRODUCT_VIEW', {$PRODUCT_ID|escape:'javascript':'UTF-8'});
}
</script>
{* Ecomail stops *}
{* Ecomail form start *}
Expand Down

0 comments on commit db1bd20

Please sign in to comment.