Hi Tim,
That is a tough one, and depends on strict you are on reading what are essential cookies. One option is to generate the tracking id, but not persist it with cookies yet, save it locally somewhere, and then when the user opts in to essential cookies, you can save it properly. Some systems don't let you force the tracking Id like this, so that might be an issue. This will let you bucket the user correctly, but you would also have to queue up the trackingCallback() call to make sure you don't fire it without consent. One other issue is that if the user refreshes, they may get a different variant.