> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name:

analytics.trackEvent(eventName: any, eventData: WixAnalyticsEventData)

# Method Link:

https://dev.wix.com/docs/sdk/host-modules/site/analytics/track-event.md

# Method Description:

Reports a [standard](https://dev.wix.com/docs/sdk/host-modules/site/events/about-analytics-events.md) or custom analytics event to external analytics tools connected to a site, such as Google Analytics, Facebook Pixel, or tools set up with Google Tag Manager.

> **Note:** Wix business solutions, such as Wix Stores or Wix Events, trigger standard events when the corresponding user action occurs on the site. However, standard events aren't automatically forwarded to external analytics platforms. Call `trackEvent()` to report them to connected platforms.

 Learn more about:

 + [Marketing integrations](https://support.wix.com/en/article/about-marketing-integrations)
 + [Connecting a Facebook Pixel to your wix site](https://support.wix.com/en/article/connecting-a-facebook-pixel-and-the-conversions-api-to-your-wix-site-7351813)
 + [Connecting a Google Analytics property to your Wix site](https://support.wix.com/en/article/tracking-events-on-your-wix-site-with-a-google-analytics-property)
 + [Connecting your Google Tag Manager account to your Wix site](https://support.wix.com/en/article/connecting-your-google-tag-manager-account-to-your-wix-site)

# Method Permissions:



# Method Permissions Scopes IDs:

undefined



# Method Code Examples:

## Report a standard event that doesn't have event data


```javascript
```typescript
import { analytics } from '@wix/site';

analytics.trackEvent("Lead");

```
```

## Report a standard event with event data


```javascript
```typescript
import { analytics } from '@wix/site';

analytics.trackEvent("ViewContent", { origin: "My Sportswear Store", id: "P12345", sku: 20, name: "Really Fast Running Shoes", price: 120, currency: "USD", category: "Apparel/Shoes", brand: "SomeBrand", variant: "Black", list: "Product Gallery", position: 1 } );

```
```

## Report a custom event


```javascript
```typescript
import { analytics } from '@wix/site';

analytics.trackEvent("CustomEvent", { eventCategory: "Sporting Goods", eventAction: "FrequentShopper", eventLabel: "November", eventValue: 1, purchase_count: 8, average_purchase_value: 245.24, currency: "USD", shipping_info: { method: "standard overnight", note: "leave at the front door" } } );

```
```