How to verify e-commerce tracking?

For Workes & Pages, what is the name of the domain?

https://www.goedeshampoo.nl/

What is the issue or error you’re encountering

GA4 does not seem to track vital e-commerce information

What steps have you taken to resolve the issue?

I have tried following the Zaraz manuals and documentation regarding e-commerce tracking. It seems I have performed all the necessary steps but GA4 does still not seem to track the events. I tried to verify this using zaraz.debug(), but I am doubtful all the information is there. How can I verify whether these events are being tracked and communicated?

Real time GA4 only shows page views.
If I go to Cloudflare backend to Zaraz > Monitoring it only shows ‘pageview’ and ’ page_consent_update’.
Should I see the events here as well

What are the steps to reproduce the issue?

Go to https://www.goedeshampoo.nl/ and check integration.

This is part of the debug copy paste:

0 consent
1 update
2 {“ad_storage”:“denied”,“ad_user_data”:“denied”,“ad_personalization”:“denied”,“analytics_storage”:“denied”,“functionality_storage”:“denied”,“personalization_storage”:“denied”,“security_storage”:“granted”}
gtm.start 1726577702
event cookie_consent_update
__zcl_track true
__zcl_visibilityChange true
gtm.uniqueEventId 10
__zarazGoogleConsentV2String 11
1p**5
__enrichPayload client
conversion true
__zarazMCListeners {“google-analytics_v4_efNZ”:[“visibilityChange”]}
en cookie_consent_update
name All other events

can you give an example of zaraz.ecommerce() call you’re making? the information you included doesn’t show that you’re using Zaraz Ecommerce at all.

Perhaps I did not understand the integration correctly. As far as I understood you only have to activate the e-commerce function in 2 locations of Cloudflare back-end. One in the Zaraz settings (E-commerce tracking), and one in the specific Tools.

I cannot find this second option anymore under GA4 (advance does not show). Did this receive an update very recently?

The guideline now also says to ‘Add e-commerce tracking to your website’. Was that added, or did I just misread it? Before it said that all events and triggers were automatically created, and now it says ‘To create a complete tracking event, you need to add an event and one or more parameters.’

In any case, I am afraid my setup is incorrect and doing something wrong. Could you guide me into how to make one of those zaraz.ecommerce() calls? I can integrate code within my but not sure what this should entail?
zaraz.ecommerce(‘Event Name’, { parameters });

I cannot find this second option anymore under GA4 (advance does not show). Did this receive an update very recently?

Yes, it was moved under “Automatic Actions” → “Ecommerce”

Could you guide me into how to make one of those zaraz.ecommerce() calls?

Please read zaraz.ecommerce and see the code examples at the end of the page

Ah, I see, things changed.

I seem to have read that activating these options would automatically inject the correct code on the relevant pages.
I have tried going through the code examples (I tried this last week as well) but don’t see how I could dynamically load this depending on the page. I understand that is the data we want for example:

product_id: '999666321',
      sku: '8251511',
      name: 'Boy’s shorts',
      price: 10,
      quantity: 2,
      category: 'shorts',)

But based on the documentation Zaraz would dynamically load these details, hence I was expecting them to show up in the debug information.

If i have to integrate that, how could I load that dynamically?
I am not asking for a full script, but more of a recommendation how to get started on this. Would this be the correct direction?

// Track View Item (Product Pages)
add_action('woocommerce_after_single_product', 'zaraz_track_view_item');
function zaraz_track_view_item() {
    global $product;
    ?>
    <script>
    zaraz.ecommerce('Product Viewed', {
        'product_id': '<?php echo $product->get_id(); ?>',
        'sku': '<?php echo $product->get_sku(); ?>',
        'category': '<?php echo wp_get_post_terms($product->get_id(), 'product_cat')[0]->name; ?>',
        'name': '<?php echo $product->get_name(); ?>',
        'price': '<?php echo $product->get_price(); ?>',
        'currency': '<?php echo get_woocommerce_currency(); ?>',
        'value': '<?php echo $product->get_price(); ?>'
    });
    </script>
    <?php
}

I cannot provide help for WooCommerce. I recommend you take a look at Beetle Tracking – Cloudflare Zaraz for WordPress – WordPress plugin | WordPress.org .

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.