Send Events to 3rd Party Analytics Apps

We’re excited to announce that you can now send events to Google Analytics and Facebook Pixel using the new trackEvent() function. Stay tuned for future announcements about supporting additional analytics apps.

How it works

  1. Connect your site to your 3rd party analytics account as described here .

  2. Call the trackEvent() function to send event data to the supported analytics apps that your site is connected to.

Events

You can send the following events or create your own custom event:

  • ViewContent

  • AddProductImpression

  • ClickProduct

  • AddToCart

  • RemoveFromCart

  • InitiateCheckout

  • AddPaymentInfo

  • Purchase

  • Lead
    Note, that although the events refer to “products”, any important item you want to track can be considered a “product”.

Example

In the following example, we demonstrate how to send an AddProductImpression event when one of your users views a product on your site:

import wixWindow from 'wix-window';
//...

wixWindow.trackEvent("AddProductImpression", {
      contents: [{
        sku: "P12345",
        name: "Really Fast Running Shoes",
        category: "Apparel/Shoes",
        price: 100,
        currency: "USD",
        brand: "Nike",
        variant: "Black",
        list: "Search Results",
        position: 1
      }]
 });

Learn more

To learn more about sending analytics events, see the trackEvent() function in the API Reference.

4 Likes

Hello, are there any detail article where to put the code, etc? i dont get it how to make it works with my web. I plan to put lead pixel tracking in WhatsApp chat button.

Hi:)
When working with multiple landing pages - what is the best way for implementing GoogleAnalytics?

  • Is it from the code or TagManager?
  • If it’s from code:
  1. The sites’ pixel doesn’t exist in the trackEvent(). Is it taken from the sites’s TagManager?
  2. What is the connection between the site’s GoogleAnalytics Wix TagManager & trackEvent()? Do they work together?
    Thanks a lot!
    Dafna

Hi, where can I find a step-by-step implementation of this function?

I want to track onClick event in Google Analytics for 1 button on my site, but I don’t understand how to actually add the code mentioned in the article.

How can I use it for Facebook pixel?

Can someone from Wix please advise us on how to actually implement this code. I’ve read the supporting material, but they simply appear to describe the code and it’s parameters, not how to implement on the Wix site.

How do I create a connection between this code and a button/link?

https://webixdesigns.wixsite.com/search-redirect site search analysis code? please help me.

Could someone from Wix please provide a solution to this. I’ve read all supporting docs as well and found that there are not solutions to implement the code on the Wix site, only providing code and it’s parameters.

Thank you.