Merge branch 'ticket-11957-removePersonalData'

This commit is contained in:
Marion Muszynski 2016-12-06 12:10:35 +01:00
commit 8db1dda6fb
3 changed files with 72 additions and 5 deletions

View File

@ -45,7 +45,21 @@
'shipping': '{$trans.shipping}', // Shipping (currency). 'shipping': '{$trans.shipping}', // Shipping (currency).
}); });
ga('send', 'pageview'); {literal}
var re = new RegExp("([?&])(email=)[^&#]*", "g");
var re2 = new RegExp("([?&])(customer_lastname=)[^&#]*", "g");
var re3 = new RegExp("([?&])(customer_firstname=)[^&#]*", "g");
if (document.location.href.match(re) || document.location.href.match(re2) || document.location.href.match(re3)) {
// remove personal data from url before sending to GA
url = window.location.search.replace(re, '$1$2');
url = url.replace(re2, '$1$2');
url = url.replace(re3, '$1$2');
var page = window.location.pathname+url;
ga('send', 'pageview', page);
} else {
ga('send', 'pageview');
}
{/literal}
{/if} {/if}
{/if} {/if}

View File

@ -157,7 +157,21 @@
{/literal}{if isset($page_name) && (($page_name == 'order-confirmation' && $isEC==0) || $page_name != 'order-confirmation')}{literal} {/literal}{if isset($page_name) && (($page_name == 'order-confirmation' && $isEC==0) || $page_name != 'order-confirmation')}{literal}
// send pageview via header.tpl du module GA si isEC=1 and $page_name == 'order-confirmation' // send pageview via header.tpl du module GA si isEC=1 and $page_name == 'order-confirmation'
ga('send', 'pageview');
var re = new RegExp("([?&])(email=)[^&#]*", "g");
var re2 = new RegExp("([?&])(customer_lastname=)[^&#]*", "g");
var re3 = new RegExp("([?&])(customer_firstname=)[^&#]*", "g");
if (document.location.href.match(re) || document.location.href.match(re2) || document.location.href.match(re3)) {
// remove personal data from url before sending to GA
url = window.location.search.replace(re, '$1$2');
url = url.replace(re2, '$1$2');
url = url.replace(re3, '$1$2');
var page = window.location.pathname+url;
ga('send', 'pageview', page);
} else {
ga('send', 'pageview');
}
{/literal}{/if}{literal} {/literal}{/if}{literal}
function onStepComplete(stepNumber, option, redirect, form) { function onStepComplete(stepNumber, option, redirect, form) {
@ -264,7 +278,20 @@
{/literal}{if isset($page_name) && (($page_name == 'order-confirmation' && $isEC==0) || $page_name != 'order-confirmation')}{literal} {/literal}{if isset($page_name) && (($page_name == 'order-confirmation' && $isEC==0) || $page_name != 'order-confirmation')}{literal}
// send pageview via header.tpl du module GA si isEC=1 and $page_name == 'order-confirmation' // send pageview via header.tpl du module GA si isEC=1 and $page_name == 'order-confirmation'
ga('send', 'pageview');
var re = new RegExp("([?&])(email=)[^&#]*", "g");
var re2 = new RegExp("([?&])(customer_lastname=)[^&#]*", "g");
var re3 = new RegExp("([?&])(customer_firstname=)[^&#]*", "g");
if (document.location.href.match(re) || document.location.href.match(re2) || document.location.href.match(re3)) {
// remove personal data from url before sending to GA
url = window.location.search.replace(re, '$1$2');
url = url.replace(re2, '$1$2');
url = url.replace(re3, '$1$2');
var page = window.location.pathname+url;
ga('send', 'pageview', page);
} else {
ga('send', 'pageview');
}
{/literal}{/if}{literal} {/literal}{/if}{literal}
function onStepComplete(stepNumber, option, redirect, form) { function onStepComplete(stepNumber, option, redirect, form) {

View File

@ -163,7 +163,20 @@
{/literal}{if isset($page_name) && (($page_name == 'order-confirmation' && $isEC==0) || $page_name != 'order-confirmation')}{literal} {/literal}{if isset($page_name) && (($page_name == 'order-confirmation' && $isEC==0) || $page_name != 'order-confirmation')}{literal}
// send pageview via header.tpl du module GA si isEC=1 and $page_name == 'order-confirmation' // send pageview via header.tpl du module GA si isEC=1 and $page_name == 'order-confirmation'
ga('send', 'pageview');
var re = new RegExp("([?&])(email=)[^&#]*", "g");
var re2 = new RegExp("([?&])(customer_lastname=)[^&#]*", "g");
var re3 = new RegExp("([?&])(customer_firstname=)[^&#]*", "g");
if (document.location.href.match(re) || document.location.href.match(re2) || document.location.href.match(re3)) {
// remove personal data from url before sending to GA
url = window.location.search.replace(re, '$1$2');
url = url.replace(re2, '$1$2');
url = url.replace(re3, '$1$2');
var page = window.location.pathname+url;
ga('send', 'pageview', page);
} else {
ga('send', 'pageview');
}
{/literal}{/if}{literal} {/literal}{/if}{literal}
function onStepComplete(stepNumber, option, redirect, form) { function onStepComplete(stepNumber, option, redirect, form) {
@ -269,7 +282,20 @@
{/literal}{if isset($page_name) && (($page_name == 'order-confirmation' && $isEC==0) || $page_name != 'order-confirmation')}{literal} {/literal}{if isset($page_name) && (($page_name == 'order-confirmation' && $isEC==0) || $page_name != 'order-confirmation')}{literal}
// send pageview via header.tpl du module GA si isEC=1 and $page_name == 'order-confirmation' // send pageview via header.tpl du module GA si isEC=1 and $page_name == 'order-confirmation'
ga('send', 'pageview');
var re = new RegExp("([?&])(email=)[^&#]*", "g");
var re2 = new RegExp("([?&])(customer_lastname=)[^&#]*", "g");
var re3 = new RegExp("([?&])(customer_firstname=)[^&#]*", "g");
if (document.location.href.match(re) || document.location.href.match(re2) || document.location.href.match(re3)) {
// remove personal data from url before sending to GA
url = window.location.search.replace(re, '$1$2');
url = url.replace(re2, '$1$2');
url = url.replace(re3, '$1$2');
var page = window.location.pathname+url;
ga('send', 'pageview', page);
} else {
ga('send', 'pageview');
}
{/literal}{/if}{literal} {/literal}{/if}{literal}
function onStepComplete(stepNumber, option, redirect, form) { function onStepComplete(stepNumber, option, redirect, form) {