feat: DataLayer GA4 analytics fix — poprawka eventów ecommerce
Naprawione eventy purchase, begin_checkout, view_item, add_to_cart do formatu GA4 (item_id/item_name zamiast id/name, currency PLN, google_business_vertical, poprawne typy danych). Dodany nowy event view_cart na stronie koszyka. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -73,10 +73,11 @@
|
||||
$begin_checkout_items .= ',';
|
||||
|
||||
$begin_checkout_items .= '{';
|
||||
$begin_checkout_items .= '"id": "' . $product['id'] . '",';
|
||||
$begin_checkout_items .= '"name": "' . $product['language']['name'] . '",';
|
||||
$begin_checkout_items .= '"item_id": "' . $product['id'] . '",';
|
||||
$begin_checkout_items .= '"item_name": "' . str_replace( '"', '', $product['language']['name'] ) . '",';
|
||||
$begin_checkout_items .= '"price": ' . \Shared\Helpers\Helpers::normalize_decimal( $price_product['price_new'] ) . ',';
|
||||
$begin_checkout_items .= '"quantity": ' . $position['quantity'];
|
||||
$begin_checkout_items .= '"quantity": ' . (int)$position['quantity'] . ',';
|
||||
$begin_checkout_items .= '"google_business_vertical": "retail"';
|
||||
$begin_checkout_items .= '}';
|
||||
?>
|
||||
<? endforeach;?>
|
||||
|
||||
Reference in New Issue
Block a user