My conversion goal does not appear when configuring the experiment
Sorry if this is a dumb question, this is my first job and my first time setting up an A/B test on my own. I created the experiment in the dashboard and everything went fine until I got to the part where you pick the primary goal, because the goal I planned to use, which is "newsletter-signup", does not show up anywhere in the dropdown no matter how much I search for it.
I should probably mention that I have not actually written any tracking code yet, I was planning to do that after configuring the experiment, in case that matters. Do I need to create the goal somewhere else first?
1 answer
You actually diagnosed it yourself in your last paragraph. The goal picker only lists events Croct has already received. A goal ID is not something you register upfront in the dashboard, it comes into existence the first time the event arrives.
So flip your order of operations: ship the tracking first, then configure the experiment. Something like this where the signup completes:
croct.track('goalCompleted', {goalId: 'newsletter-signup'});Deploy that, trigger it once yourself, verify the event arrives, and "newsletter-signup" will appear in the dropdown.
One shortcut worth knowing: auto-tracked events like orderPlaced, and conversion events coming from integrations, are available as goals without writing any code. But for a custom goal like yours the event has to flow at least once before you can select it.
And for what it is worth, this trips up plenty of people well past their first job, so no need for the apology.
Thank you so much for being kind about it! Shipped the tracking this morning and the goal showed up right after the first test signup.