Learn how to pass a property with custom events in GoodMetrics to add context to a single event instead of creating many separate events.
You can pass a property with any custom event to attach context to it, such as a destination URL, a plan name, or a category. This lets you use a single, well-named event and break it down by property value, instead of creating a separate event for every variation.
Syntax
Section titled “Syntax”gmTrackEvent('event_name', { property: 'your property' });The property field accepts a string. Each event sends a single property value.
You can also combine a property with a value:
gmTrackEvent('Purchase', { value: 5000, property: 'team' });Example use cases
Section titled “Example use cases”Tracking outbound link clicks
Section titled “Tracking outbound link clicks”Use one event for all outbound clicks and pass the destination URL as the property. This keeps your reports tidy — a single Outbound Link Click event with a total count, broken down by which URL was clicked:
gmTrackEvent('Outbound Link Click', { property: 'https://example.com/pricing' });Tracking purchases by plan
Section titled “Tracking purchases by plan”Instead of separate Purchase Starter, Purchase Pro, and Purchase Team events, send one Purchase event and pass the plan as the property:
gmTrackEvent('Purchase', { value: 5000, property: 'team' });You get one Purchase event with your total purchase count and revenue, broken down by plan.
How properties appear in your dashboard
Section titled “How properties appear in your dashboard”In the Top Events report, events that have properties can be expanded. Click the event to reveal a breakdown of its property values, each with its own event counts and total value.
Conversion rate is measured at the event level
Section titled “Conversion rate is measured at the event level”Conversion rate is reported for the event as a whole — the share of sessions in which the event occurred. Because a property value is a slice of an event rather than a separate goal, individual property values show a dash (—) in the Conversion Rate column.
For example, an Outbound Link Click event has a single conversion rate across all clicks. The individual URLs beneath it show their counts but not their own conversion rate.
- The
propertyfield must be a string. - Each event sends one property value. To capture multiple dimensions, use a separate, descriptively named event for each.
- You can combine
propertywithvaluein the same call. - Property values appear in your dashboard once events start arriving.