Manual event tracking
Use trackEvent() when you need to send Cevoid widget interaction events manually from custom storefront code.
Use this page when you need to call trackEvent() yourself from custom storefront code. If you are using standard Cevoid galleries or cards, do not start here. Those widget surfaces already emit the core Cevoid UGC events automatically.
For payload-by-payload reference, use SDK API and Event types.
When to use trackEvent()
Use trackEvent() when:
- you render Cevoid interactions in your own storefront UI
- you need to manually mirror Cevoid widget-style actions from custom code
- you want those custom interactions to follow the supported Cevoid event names
Do not use trackEvent() just to forward standard gallery or card events into GA or GTM. In that case, use Forward browser events to GA.
1. Initialize the SDK
Initialize the SDK once before the first tracking call.
import { init } from '@cevoid/analytics-sdk'
init({
publishableKey: 'cev_pk_...'
})React example:
import { Analytics as CevoidAnalytics } from '@cevoid/analytics-sdk/react'
export function App() {
return <CevoidAnalytics publishableKey="cev_pk_..." />
}Verification:
- trigger one manual call in the browser
- confirm your handler runs without an initialization error
- if browser events are enabled, confirm a matching
cevoid:<event-name>CustomEvent fires onwindow
2. Send supported event names
Send the exact dotted Cevoid event name that matches the UI action.
import { trackEvent } from '@cevoid/analytics-sdk'
trackEvent('widget.load', {
widgetId: 'gallery-homepage',
postsLoadedCount: 12
})
trackEvent('post.click', {
widgetId: 'gallery-homepage',
postId: 'post_123',
postPosition: 1
})Leave out widgetType. The SDK sets it to api on every trackEvent() call and overrides any value you pass.
Common manual event groups:
- widget lifecycle:
widget.load,widget.view - post interactions:
post.view,post.click,post.view.popup,post.clap - product interactions:
product.click.tag,product.click.post,product.click.card - gallery actions:
gallery.load_more,gallery.upload_cta_click
3. Use real Cevoid IDs
Pass the real Cevoid identifiers from the rendered experience:
widgetIdpostIdproductIdmarketIdwhen relevant
Do not substitute labels, DOM IDs, or storefront-only identifiers unless they are the actual Cevoid IDs used by your integration.
4. Keep payload details in the reference pages
Use the reference pages for accepted values and field requirements:
Common mistakes
- calling
trackEvent()beforeinit() - using manual tracking for standard Cevoid galleries or cards when the events are already emitted automatically
- using the wrong event name for the actual UI surface
- omitting required Cevoid IDs