Wix.Analytics

trackEvent

trackEvent(eventName, params)

Reports an event in the live site to the user’s analytics tool, like Facebook Pixel or Google Analytics.

Parameters:

NameTypeDescription

Example:

Events

You can report the following events with trackEvent:

  • AddProductImpression – When a visitor views a product
  • ClickProduct – When a visitor clicks on a product
  • ViewContent – When a key page is viewed (such as a product page)
  • AddToCart – When a visitor adds a product to the shopping cart
  • RemoveFromCart – When a visitor removes a product from shopping cart
  • InitiateCheckout – When a visitor starts the checkout process
  • StartPayment – When a visitor starts the payment process
  • AddPaymentInfo – When the visitor saves payment information
  • CheckoutStep – When a visitor enters a custom checkout step
  • Purchase – When the checkout process is complete
  • Lead – When a visitor subscribes to a newsletter or submits a contact form
  • CustomEvent – When a visitor performs an event not listed above
Important:
In these events we refer to “products”, but a product can be any important item the user is tracking, like a service, event, music track or album, etc.

AddProductImpression

origin, contents[{id, sku, name, price, currency, category, brand, variant, list, position}]

Report this event when a visitor views a product or item.

Parameters:

NameTypeDescription

Example:

ClickProduct

{origin, id, sku, name, price, currency, category, brand, variant, list, position}

Report this event when a visitor clicks on a product or item.

Parameters:

NameTypeDescription

Example:

ViewContent

{origin, id, sku, name, price, currency, category, brand, variant, list, position}

Report this event when a visitor views a key page, like the product page.

Parameters:

NameTypeDescription

Example:

AddToCart

{origin, id, sku, name, price, currency, category, brand, variant, position, quantity}

Report this event when a visitor clicks a button to add a product to the shopping cart (e.g., when the Add to Cart button is clicked).

Parameters:

NameTypeDescription

Example:

RemoveFromCart

{origin, id, name, price, currency, category, brand, variant, position, quantity}

Report this event when a visitor clicks a button to remove a product from the shopping cart.

Parameters:

NameTypeDescription

Example:

InitiateCheckout

origin, contents[{id, sku, name, price, currency, category, brand, variant, quantity}]

Report this event when a visitor clicks a button to begin the checkout process.

Parameters:

NameTypeDescription

Example:

StartPayment

{origin, option}

Report this event when a visitor reaches a payment form, before making a purchase.

Parameters:

NameTypeDescription

Example:

AddPaymentInfo

{origin, option}

Report this event when a visitor clicks a button to save payment info for a purchase.

Parameters:

NameTypeDescription

Example:

CheckoutStep

{origin, step, action, option}

Report this event for any custom checkout interaction that a visitor completes between initiating a checkout and completing a purchase.

Parameters:

NameTypeDescription

Example:

Purchase

{origin, id, affiliation, revenue, tax, shipping, coupon, contents}

Report this event when a purchase is completed successfully.

Parameters:

NameTypeDescription

Example:

Lead

Report this event when a visitor subscribes to a newsletter or submits a contact form.

Example:

CustomEvent

{event, *}

Report a custom event that doesn’t fit any of the standard events listed above.

Parameters:

NameTypeDescription

Example:

Deprecated

reportCampaignEvent

Important:
Now that this method is deprecated, use trackEvent instead.

Reports an event that happened in your app on the live site. The event is sent to all registered pixels on the site – even pixels used in other apps.

Parameters:

NameTypeDescription

Example:

registerCampaignPixel

Registers and initializes the Facebook pixel on the live site. The pixel registration is saved for this session only, so call this method every time your app loads in the live site.

Parameters:

NameTypeDescription

Example:

Was this page helpful?

What can we do to improve it?

What did you like about it?