add deug_mode switch

This commit is contained in:
MaxBUhe 2023-08-16 10:44:50 +02:00
parent 7b1241ab97
commit 9e7b4653ea
8 changed files with 27 additions and 8 deletions

View File

@ -46,7 +46,9 @@
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
[{/foreach}]
]
}
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
})
[{/strip}]
[{/capture}]

View File

@ -40,7 +40,9 @@
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
[{/foreach}]
]
}
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]

View File

@ -30,7 +30,9 @@
'price': [{$d3PriceObject->getPrice()}]
}
]
}
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]

View File

@ -41,7 +41,9 @@
'quantity': iArtQuantity
}
]
}
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
});
[{/strip}]

View File

@ -37,7 +37,9 @@
}[{if !$smarty.foreach.gtmRemovedItems.last}],[{/if}]
[{/foreach}]
]
}
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]

View File

@ -35,7 +35,9 @@
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
[{/foreach}]
]
}
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]

View File

@ -9,7 +9,7 @@
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_search_result',
'eventLabel':'view_search_result',
'eventLabel':'view_search_result[{if $oViewConf->isDebugModeOn()}]_test[{/if}]',
'ecommerce': {
'search_term': '[{$searchparamforhtml}]',
'items': [
@ -33,7 +33,9 @@
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
[{/foreach}]
]
}
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]

View File

@ -203,6 +203,11 @@ class ViewConfig extends ViewConfig_parent
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
}
public function isDebugModeOn() :bool
{
return Registry::getConfig()->getConfigParam('d3_gtm_blEnableDebug');
}
public function isPromotionList($listId)
{
$oConfig = Registry::getConfig();