Composite Goals
A composite goal combines several existing goals into a single goal. A unit achieves the composite goal when it completes any one of the goals it is made of.
Composite goals are useful when the same outcome is tracked under different goal names. For example:
- A purchase is tracked as
payment_webon the website andpayment_appin the mobile app - A sign-up event was renamed from
signuptoregistrationand older code still sends the old name - Several micro-conversions such as
add_to_wishlist,share_productandsave_for_latertogether describe engagement
Instead of building a separate metric for each goal, you create one composite goal and build your metrics on top of it, exactly as you would with any other goal.
Creating a composite goal
Composite goals are created from Settings > Goals, in the same way as any other goal.
- Enter a Goal name and a Description
- Set Goal type to
Composite Goal - In Component Goals, select the goals to combine
- Optionally, filter the events counted from each component goal
- Optionally, map the properties you want to use in metrics
- Add Owners and Tags, then save
Component goals
Select at least two goals using Select a goal, and use Add another goal to add more. Each goal can only be used once in the same composite goal.
Only simple goals can be used as component goals. A composite goal cannot be made of other composite goals, and archived goals cannot be selected.
The Goal type and the list of component goals cannot be changed once the composite goal has been created. To combine a different set of goals, create a new composite goal. The event filters and property mappings can still be edited at any time.
Filtering events
By default, every event from a component goal counts towards the composite goal. Expand Filter events under a component goal to count only the events whose properties match specific conditions.
For example, if payment_web is also used for gift card purchases, you could filter it on product_type so that only product purchases count towards the composite goal.
The filter is written against the properties of that specific component goal, so each component goal has its own filter. Choosing a different goal for a row clears its filter.
Property mapping
Component goals don't always use the same names for the same data. For example, payment_web might send the amount as total while payment_app sends it as amount.
Property Mapping lets you define properties on the composite goal and map them to the matching property of each component goal:
- Click Add another property and enter a Property name for the composite goal, for example
revenue - Under Map to component goal properties, enter the property each component goal uses, for example
totalforpayment_webandamountforpayment_app
| Composite goal property | payment_web | payment_app |
|---|---|---|
revenue | total | amount |
currency | currency | currency_code |
The mapped properties can then be used in metrics built on the composite goal, both as the metric's property and in property filters.
Using composite goals in metrics
A composite goal can be selected as the goal of a metric like any other goal. The metric then counts the events of every component goal, after applying each goal's event filter.
For example, with a composite goal purchase combining payment_web and payment_app:
- A goal count metric counts purchases made on both the website and the app
- A goal property metric on
revenuesumstotalfrompayment_webandamountfrompayment_app
Composite goals cannot currently be used as the foreign goal of a goal relation, such as a cancellation or a refund.
Tracking composite goals
Nothing changes in your code. Composite goals are built from the goals you already track with the SDK's track method, so you don't send events for the composite goal itself. See Goal Events for more details on tracking goals.