Counting purchases as the conversion goal for a Hydrogen experiment
Setting up our first experiment on a Hydrogen store. Current state:
- Product views and cart events show up in the dashboard automatically
- The experiment editor asks for a primary Goal ID
- I want the goal to be completed purchases, not cart adds
In GA4 land I would just pick the purchase event, but here I do not see purchases in the goal picker. Do I need to send something first, and if so which event exactly and from where?
1 answer
The goal picker only shows events that are already being tracked, which is why purchases are not there yet. The auto events from Shopify's storefront analytics cover views and cart activity, but the purchase itself is one you send through the SDK.
Two options:
- orderPlaced is the purpose-built event for completed orders.
- goalCompleted with a goalId like purchase-completed works if you want a plain named goal.
Send it from your order confirmation flow, let at least one event come through, and the goal becomes selectable as the experiment's primary Goal ID.
One warning before you launch: settle the traffic allocation and the variant list first. Changing traffic distribution or adding and removing variants mid-experiment is strongly discouraged because it invalidates the statistics, and with a purchase goal you will not want to restart.
Sent orderPlaced from the confirmation route, and it appeared in the picker within a few minutes. Locking variants before launch, thanks.