Sends a tracking event to external analytics tools.
Sends an event to analytics tools connected to a site. It can send events to Google Analytics, Facebook Pixel or analytics tools set up with the Google Tag Manager.
Learn more about:
Note: This method only runs on published versions of a site. It doesn't work when previewing a site.
The trackEvent()
method lets you track both standard and custom events.
The following standard events are supported:
Standard Event | Description | Used By |
---|---|---|
AddPaymentInfo | When a site visitor saves payment information. | Google Analytics , Facebook Pixel |
AddProductImpression | When a site visitor views a product. | Google Analytics |
AddToCart | When a site visitor adds a product to the shopping cart. | Google Analytics , Facebook Pixel |
CheckoutStep | When a site visitor completes a checkout step. | Google Analytics |
ClickProduct | When a site visitor clicks on a product. | Google Analytics |
CompleteRegistration | When a site visitor completes the registration. Note: The CompleteRegistration event doesn't take any parameters. | Facebook Pixel |
InitiateCheckout | When a site visitor starts the checkout process. | Google Analytics , Facebook Pixel |
Lead | When a site visitor subscribes to a newsletter or submits a contact form. | Google Analytics , Facebook Pixel |
Purchase | When the customer successfully completes the checkout process. | Google Analytics , Facebook Pixel |
RemoveFromCart | When a site visitor removes a product from the shopping cart. | Google Analytics |
Schedule | When a site visitor schedules a meeting or makes an appointment. Note: The Schedule event doesn't take any parameters. | Facebook Pixel |
StartPayment | When a site visitor starts the payment process. | Google Analytics |
ViewContent | When a site visitor views a key page, for example the product page. | Google Analytics , Facebook Pixel |
Event name. Applies to both standard and custom events. The following standard events are supported:
AddPaymentInfo
AddProductImpression
AddToCart
CheckoutStep
ClickProduct
CompleteRegistration
InitiateCheckout
Lead
Purchase
RemoveFromCart
Schedule
StartPayment
ViewContent
The event's parameters. Note: The CompleteRegistration
and Schedule
events don't take any parameters.
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.