Custom Metrics Events
Dispatch a custom event that will appear in the Clicks section of the metrics page.
window.wyng['_WYNG_ID_'].dispatchMetricEvent(payload);
Parameters
dispatchCampaignAction
accepts a single paramter, an object containing the following:
Key | Type | Description | Example |
---|---|---|---|
subtype | string - required | The name of your event | Register button clicked , Purchase |
qualifier | string | An optional additional grouping option for the subtype | Footer , Face Cream |
quantity | number | An optional number. e.g. a purchase price | 100 , 24.99 |
Example
- Basic Example
- w/ Qualifier
- Purchase example
window.wyng['_WYNG_ID_'].dispatchMetricEvent(
{
subtype: 'Register Button Clicked',
}
)
window.wyng['_WYNG_ID_'].dispatchMetricEvent(
{
subtype: 'Register Button Clicked',
qualifier: 'page 2',
}
)
window.wyng['_WYNG_ID_'].dispatchMetricEvent(
{
subtype: 'Purchase',
qualifier: 'SKU #139217421',
quantity: 32.99,
}
)
Displaying events
Your custom events will be displayed on the Metrics page of your Wyng Property, under the Clicks card.
The Custom Events data table has 4 columns: Subtype, Qualifier, Count and Quantity.
- Count will show the number of events with a given Subtype and Qualifier.
- Quantity sums up the Quantities of all events with the given Subtype and Qualifier.
Subtype | Qualifier | Count | Quantity (sum) |
---|---|---|---|
Register button clicked | footer | 240 | |
Register button clicked | header | 196 | |
Purchase | Face Cream | 76 | 987.24 |
Register button clicked | form 2 | 53 | |
Purchase | Shampoo | 42 | 1270.05 |