sparse-australia-53384
11/02/2023, 5:49 PM<script defer='defer' id='growthbook-sdk' src='<https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/index.js>'></script>
<script>
(function() {
// wait for async load
if (window.growthbook) {
startGrowthbook();
} else {
document.querySelector("#growthbook-sdk").addEventListener("load", startGrowthbook);
}
function startGrowthbook() {
if(!window.growthbook) return;
window.gb = new growthbook.GrowthBook({
apiHost: "<https://cdn.growthbook.io>",
clientKey: "XXXXXXXX",
decryptionKey: "XXXXXXXX",
enableDevMode: false,
subscribeToChanges: true,
attributes: {
id: "1056967161.1698327286",
client_id: "1056967161.1698327286",
user_id: undefined,
signed_in: false,
membership_type: "anonymous"
},
trackingCallback: function(experiment, variant) {
dataLayer.push({
event: 'experiment_impression',
experiment_id: experiment.key,
variant_id: variant.key
});
}
});
gb.loadFeatures();
}
})();
</script>
rhythmic-agent-34208
11/02/2023, 5:49 PMbrief-honey-45610
11/02/2023, 6:18 PMrhythmic-agent-34208
11/03/2023, 12:42 AMsparse-australia-53384
11/03/2023, 9:41 AMuser_id
is set only for signed-in users. Anonymous users do not have a valid user_id
3. client_id
is either a user_id (user signed in) OR _ga cookie (gdpr opt-in) OR random number used through the session
4. yes - the client_id is passed through and set up as an attribute (see screens on the original post)rhythmic-agent-34208
11/03/2023, 3:41 PMsparse-australia-53384
11/03/2023, 6:59 PMrhythmic-agent-34208
11/08/2023, 8:19 PMsparse-australia-53384
11/09/2023, 9:11 AMbillions-xylophone-11752
11/09/2023, 8:19 PMsparse-australia-53384
11/15/2023, 11:49 AMswift-helmet-3648
11/16/2023, 6:49 PMsparse-australia-53384
11/16/2023, 8:03 PMswift-helmet-3648
11/17/2023, 5:09 PMsparse-australia-53384
11/18/2023, 10:57 AMswift-helmet-3648
11/20/2023, 3:31 PMsparse-australia-53384
11/21/2023, 8:52 AM