Wix eCommerce: Integrations, Monitoring and Analytics

When a website is created using Wix, visitor activities carried out on the website can be tracked via Wix's various integration solutions. The solutions discuss

Ceyhun Enki Aksan
Ceyhun Enki Aksan Entrepreneur, Maker

Wix and its e-commerce feature, Wix eCommerce, I will now discuss the core information about What is Wix?, continuing from the section on “What is Wix?” The following section will focus on Wix’s Marketing & SEO section, specifically the Marketing Integrations offering Google Analytics 4 (GA4), Google Tag Manager (GTM), and Ads integrations.

When a website is created through Wix, visitor actions on that site can be tracked via Wix’s various integration solutions. The integrations discussed in this article—although specifically Google Ads, GA4, and GTM—can be expanded to include both direct and app marketplace-based integrations, thereby increasing the range of available integrations.

Wix - Integrations
Wix - Integrations

The integration options listed under the Marketing Integrations section are considered as widgets added to the Custom Code field and can be managed through this same section.

Wix - Custom Code
Wix - Custom Code

Let’s first examine the integration options that provide direct data flow.

Google Analytics 4 (GA4) Integration

The Google Analytics integration option available under the Marketing Integrations section allows for a straightforward data flow to the relevant GA4 property by entering the Measurement ID. As soon as the connection is activated, events such as page_view, view_item_list, select_content, view_item, add_to_cart, remove_from_cart, begin_checkout, checkout_progress during the payment step, add_payment_info during the review step, and purchase upon completion of the purchase are sent.

Wix - Google analytics 4
Wix - Google analytics 4

Parameters sent within e-commerce events (view_item_list, view_item, add_to_cart, remove_from_cart, begin_checkout, purchase) are as follows:

{
    "currency": "TRY",
    "event_action": "Add to Cart",
    "event_category": "Enhanced Ecommerce - Stores",
    "event_label": "This is a product",
    "items": [
        {
            "category": "All Products",
            "id": "73fe33fb-4a89-4b12-916d-83f0ef347bee",
            "name": "This is a product",
            "price": 20,
            "quantity": 1,
            "sku": "364215375135191"
        }
    ]
}

Overall, a basic GA4 data flow is observed. However, the absence of the value parameter as an event parameter can hinder the tracking and marking of events as conversions. Additionally, when a product price has a discount, the event will capture the discounted value; there is no separate discount parameter at the product level. In the purchase event, there is no tax or shipping parameter.

Google Ads integration operates in parallel with Google Analytics 4 integration, featuring a parallel event flow. However, conversion tags cannot be assigned through the integration.

Wix - Google Ads Remarketing
Wix - Google Ads Remarketing
Wix - Google Ads
Wix - Google Ads

For conversion setup, the relevant events must be imported via GA41 2. Custom code addition fields can be used for defining conversion tags with specific data payloads3 4.

Wix - Custom Codes
Wix - Custom Codes

The custom code addition can be performed either under the Settings section in the Custom Code section, or at a more advanced level via the Editor tool.

In consent management, relevant custom codes can be linked to specific categories.

Wix - Content Management
Wix - Content Management

The following events and parameters are sent.

Google Tag Manager (GTM) Integration

When Google Tag Manager (GTM) integration is implemented, the relevant e-commerce events are sent in Universal Analytics (UA) format5.

Wix - Google Tag Manager
Wix - Google Tag Manager

Events are sent for page views as Pageview, and for e-commerce events as productImpression, productClick, viewContent, addToCart, checkout, purchase, and for checkout steps (payment and review) as checkoutOption.

The purchase event, sent together with payment confirmation, also includes tax and shipping information.

Regarding discount amounts, similar to GA4, the discounted amount is sent, and in the dataLayer content outside of purchase, the value and currency fields are not included at the event level. In such cases, it is recommended to retrieve relevant information from the product via a separate JavaScript operation within GTM and pass it at the event level.

The relevant dataLayer content, in the context of events, is as follows.

When using variables and mapping operations in dataLayer actions, it is important to note that the ecommerce field is not reset in the sent dataLayer content, and in such cases, the value of the previous variable may be passed. Hence, special attention should be paid to this6.

dataLayer.push({ecommerce:null});

With GTM, the setup of Ads and GA4 triggers can be carried out using the dataLayer selection7. However, in cases where requirements such as standardization of trigger names arise, intervention may be necessary via a Lookup Table or an external JavaScript file.

Wix - Google Tag Manager
Wix - Google Tag Manager

Custom Code and Event Management

For scenarios involving existing or custom triggers (e.g., modal usage, transmission of different parameters, transmission of missing e-commerce triggers, etc.), Velo by Wix can be used to create customEvent structures. However, it is more advisable to first verify whether an app solution exists to meet the specific needs8.

note

For a comprehensive view of how Wix eCommerce handles proper tracking of e-commerce events and delivers data to numerous different analytics and measurement tools, click here!

If an appropriate solution is not available, the backend and frontend options available in the Editor section can be utilized. By using JavaScript code leveraging Node.js packages, the relevant packages can be integrated into the working environment, enabling full integration with all data fields9.

Wix - Ecommerce Tracking
Wix - Ecommerce Tracking

The following code snippet can be examined as an example of a customEvent definition10 11 12.

import wixWindowFrontend from 'wix-window-frontend';
import wixLocationFrontend from 'wix-location-frontend';

$w.onReady(function () {
    // Define reusable functions
    const trackEvent = (eventCategory, eventAction, ecommerce, page) => {
        const customEventObject = {
            eventCategory: eventCategory,
            eventAction: eventAction,
            ecommerce: ecommerce,
            page: page,
        };

        wixWindowFrontend.trackEvent("CustomEvent", customEventObject);
        console.log(customEventObject);
    };

    const trackPageView = () => {
        const pageObj = {
            eventCategory: "dnm_initial",
            eventAction: "dnm_page_view",
            page: {
                referrer: wixWindowFrontend.referrer,
                location: wixLocationFrontend.url,
                query: wixLocationFrontend.query,
                prefix: wixLocationFrontend.prefix,
                path: wixLocationFrontend.path
            }
        };

        trackEvent(pageObj.eventCategory, pageObj.eventAction, null, pageObj.page);
    };

    const trackViewItem = (product) => {
        const currency = product.currency;
        const productId = product._id;
        const productName = product.name;
        const productPrice = product.price;
        const productQuantity = 1; // Set the quantity as needed
        const productDiscountedPrice = product.discountedPrice || 0; // Assuming discountedPrice is available
        const productDiscount = product.discount?.value || 0; // Assuming discountedPrice is available
        const productSlug = product.slug;
        const collections = product.collections || '';
        const productVariant = product.variants[0].variant.sku;
    };
});

const ecommerce = {
            currency: currency,
            value: productDiscountedPrice * productQuantity,
            items: [{
                item_id: productId,
                item_name: productName,
                item_price: productPrice,
                quantity: productQuantity,
                currency: currency,
                item_variant: productVariant,
                item_discounted_price: productDiscountedPrice,
                item_category: collections,
                discount: productDiscount,
                slug: productSlug
            }]
        };

        trackEvent("dnm_ecommerce", "dnm_view_item", ecommerce);
        trackEvent("dnm_ecommerce", "reset", null);
    };
});

The output of the code can be seen in the following example images.

Wix - view_item
Wix - view_item
Wix - page_view
Wix - page_view
Wix - eCommerce Reset
Wix - eCommerce Reset

The customEvent definitions are passed to the dataLayer. Additionally, the visitorId parameter is included in this content.

Code snippets that can be used across all pages via the masterPage.js file can also be processed by the theme side.

Wix Data API queries and performance changes, as well as reports, can be tracked through the Analytics section.

Wix - masterPage
Wix - masterPage

In Summary

While GA4 and Ads integrations provide convenient solutions for general requirements, they may have limitations when it comes to customized use cases and additional service integrations. In such scenarios, GTM can be leveraged. However, there may be certain restrictions when using GTM, depending on the theme structure.

For additional parameters and features at this stage, Editor can be used to send required data flows directly or indirectly to GTM and, of course, to other services, or data can be obtained from different services and made available for use via Wix.

Footnotes

  1. Improve Conversion Tracking with Google Analytics
  2. Add Google Ads Retargeting and Conversion Tracking Feature to Your Wix Site
  3. Track Google Ads Conversions Using Wix Custom Code
  4. E-commerce Measurement. Google Analytics 4
  5. GA4 E-commerce (Tag Manager): Send GA4 Events
  6. E-commerce Measurement. Google Analytics 4, Recommended actions. Google Analytics 4
  7. Monitoring Google Ads Conversions Using Google Tag Manager
  8. Wix App Market
  9. Wix Developers
  10. Velo Reference. API Overview
  11. Velo Reference. trackEvent()
  12. Velo Tutorial: Sending Tracking and Analytics Events. Wix Help Center