hello, which code you added to the template?
wth opc you do not need to alter the templates in matters of the GTM initialization script or in matters of the datalayer.
i suggest to check OPC's implementatoin of GTM this way:
- remove all your GTM plugins and scripts from your templates
- in opc tracking enable GTM
- assign it some order statuses for which the conversion event will be triggered (like confirmed or similar)
- have your agency configure your GTM per the Datalayer and Events provided by OPC (see GTM debug to see all variables that are sent to GTM from OPC)
advanced:
- to properly track only products that are shown to customer (instead of all products loaded at a page request) you may want to alter your category template (or sublayouts/products.php) template to add this:
- Code: Select all
$dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger('plgUpdateCategoryProducts', array(&$this->products));
$document = JFactory::getDocument ();
$document->addScriptDeclaration ($js);
and to support some advanced OPC extensions from within product single template (or any template which uses a product object)
- Code: Select all
$dispatcher = JEventDispatcher::getInstance();$dispatcher->trigger('plgUpdateProductObject', array(&$this->product));
and within the products loop or product itself:
- Code: Select all
foreach ($this->products as $product) {
$list = 'Category: '.$product->category_name;
JEventDispatcher::getInstance()->trigger('plgEchoProductOnShow', array(&$product, 2, 'scroll', 'impressions', $list));
at product page itself:
- Code: Select all
$list = 'Category: '.$this->product->category_name;
JEventDispatcher::getInstance()->trigger('plgEchoProductOnShow', array(&$this->product, 2, 'productView', 'detail', $list));
best regards, stan
[/code]