Skip to content

Commit a7ad285

Browse files
committed
Remake quickview
1 parent 6145f2e commit a7ad285

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

classes/GoogleAnalyticsTools.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,18 @@ public function addProductClick($products, $currencyIsoCode)
165165
],
166166
];
167167

168+
// Add send_to parameter to avoid sending extra events
169+
// to other gtag configs (Ads for example).
170+
$eventData = array_merge(
171+
['send_to' => Configuration::get('GA_ACCOUNT_ID')],
172+
$eventData
173+
);
174+
168175
$productId = explode('-', $product['id']);
169176
$js .= '$(\'article[data-id-product="' . $productId[0] . '"] a.quick-view\').on(
170177
"click",
171178
function() {
172-
' . $this->renderEvent('select_item', $eventData) . '
179+
gtag("event", "select_item", ' . json_encode($eventData, JSON_UNESCAPED_UNICODE) . ')
173180
});';
174181
}
175182
} else {

0 commit comments

Comments
 (0)