For anything that happens in your code or your backend, use an event goal.
Create an event goal
1
Send the event
Make sure the event reaches pagent, from your site code, an observed source or your backend. It is listed under Tracking → Sources → Events once it has arrived.
2
Create the goal
Go to Tracking → Goals, click New goal and choose Event goal. Select the Event. Events that have only been observed so far are marked
(observed).3
Choose how to count
Count conversions sets how often one visitor can convert: Once per session (default), Once per visit or Every time. Optionally set a Goal Name; it defaults to the event label.
4
Save
Click Add Goal.
Advanced settings
Open Advanced in the goal dialog for:- Measure: Converted (did the visitor convert), Count (how many times), Sum (a numeric payload field such as
cart.items) or Revenue (the event’srevenue). - Only count users with at least N occurrences, for Count and Sum.
- Counting window: count only conversions within a number of hours After exposure to the test (default 72), or only during the Final days of the test (default 14).
- Delay: start counting a number of hours after exposure. A negative value includes conversions from just before exposure.
- Outlier capping for revenue and sums: Automatic, Percentile, Fixed or Off.
- Goal direction: Higher is better or Lower is better, for goals like cart abandonment or error rate.
Add goals to a test
- Open the test in the Editor.
- Under the settings icon, open Manage conversion goals.
- Add the goal and choose whether it is the primary goal.
Migrating from programmatic goals
Programmatic goals only counted conversions sent withkind: "conversion" and a label matching the goal, and only once that goal had been published to your site. Moving to events takes three steps.
1
Send an event with the same label
Change Replace
kind: "conversion" to kind: "event". Keep the label, revenue and properties as they are.window.pagent.track("signup") with window._pgnt.push({ kind: "event", label: "signup" }). On your backend, move from /v2/conversions to /v2/events.2
Create an event goal
Create an event goal on the label as described above and add it to your new tests.
3
Retire the programmatic goal
Once no running test uses the programmatic goal anymore, archive it.