Skip to content

Commit

Permalink
Fix tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael committed Jul 3, 2024
1 parent b263e98 commit 2b5b721
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions 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.17';
$this->version = '2.0.18';
$this->author = 'Ecomail';
$this->need_instance = 0;
$this->ps_versions_compliancy = ['min' => '1.7.0.0', 'max' => _PS_VERSION_];
Expand Down Expand Up @@ -776,8 +776,8 @@ public function hookDisplayFooter(array $params): string
'ECOMAIL_APP_ID' => Configuration::get('ECOMAIL_APP_ID'),
'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,
'EMAIL' => $this->context->cookie->email,
'PRODUCT_ID' => Tools::getValue('id_product'),
]
);

Expand Down
10 changes: 5 additions & 5 deletions ecomailemailmarketing/views/templates/hook/ecomail_scripts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
}(window,document,"script","//d70shl7vidtft.cloudfront.net/ecmtr-2.4.2.js","ecotrack"));
window.ecotrack('newTracker', 'cf', 'd2dpiwfhf3tz0r.cloudfront.net', { /* Initialise a tracker */ appId: '{$ECOMAIL_APP_ID|escape:'javascript':'UTF-8'}'});
if ('{$EMAIL|escape:'javascript':'UTF-8'}' !== 'empty'){
{if !empty($EMAIL|escape:'javascript':'UTF-8')}
window.ecotrack('setUserId', '{$EMAIL|escape:'javascript':'UTF-8'}');
} else {
{else}
window.ecotrack('setUserIdFromLocation', 'ecmid');
}
{/if}
window.ecotrack('trackPageView');
if ({$PRODUCT_ID|escape:'javascript':'UTF-8'}){
{if !empty($PRODUCT_ID|escape:'javascript':'UTF-8')}
window.ecotrack('trackStructEvent', 'ECM_PRODUCT_VIEW', {$PRODUCT_ID|escape:'javascript':'UTF-8'});
}
{/if}
</script>
{* Ecomail stops *}
Expand Down

0 comments on commit 2b5b721

Please sign in to comment.