Skip to content

Commit bc17545

Browse files
[*] MO : Missing anonymizer tag
1 parent 859208f commit bc17545

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

ps_googleanalytics.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ public function hookdisplayHeader($params, $back_office = false)
312312
$user_id = (int)$this->context->customer->id;
313313
}
314314

315+
$ga_anonymize_enabled = Configuration::get('GA_ANONYMIZE_ENABLED');
316+
315317
if ((int)Configuration::get('GA_CROSSDOMAIN_ENABLED') && $is_multistore_active && sizeof($shops) > 1) {
316318
$ga_crossdomain_enabled = true;
317319
}
@@ -324,6 +326,7 @@ public function hookdisplayHeader($params, $back_office = false)
324326
'gaAccountId' => Tools::safeOutput(Configuration::get('GA_ACCOUNT_ID')),
325327
'shops' => $shops,
326328
'gaCrossdomainEnabled' => $ga_crossdomain_enabled,
329+
'gaAnonymizeEnabled' => $ga_anonymize_enabled,
327330
'useSecureMode' => Configuration::get('PS_SSL_ENABLED')
328331
)
329332
);

views/templates/hook/ps_googleanalytics.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
{if $userId && !$backOffice}
4949
ga('set', 'userId', '{$userId|escape:'htmlall':'UTF-8'}');
5050
{/if}
51+
{if $gaAnonymizeEnabled}
52+
ga('set', 'anonymizeIp', true);
53+
{/if}
5154
{if $backOffice}
5255
ga('set', 'nonInteraction', true);
5356
{/if}

0 commit comments

Comments
 (0)