aloof-intern-85196
03/04/2024, 10:31 PMhappy-autumn-40938
03/05/2024, 12:33 AMaloof-intern-85196
03/05/2024, 4:19 PMhappy-autumn-40938
03/05/2024, 7:54 PMaloof-intern-85196
03/07/2024, 7:15 PMcreate_UUID = () => {
let dt = new Date().getTime();
let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
let r = (dt + Math.random() * 16) % 16 | 0;
dt = Math.floor(dt / 16);
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
return uuid;
}
let visitor_id = localStorage.getItem("growthbook_visitor_id");
if (!visitor_id) {
visitor_id = create_UUID();
localStorage.setItem('growthbook_visitor_id', visitor_id)
}
const growthbook = new GrowthBook({
apiHost: process.env.GATSBY_GROWTHBOOK_API_HOST,
clientKey: process.env.GATSBY_GROWTHBOOK_CLIENT_KEY,
enableDevMode: true,
attributes: {
id: visitor_id,
url: window.location.href,
},
trackingCallback: (experiment, result) => {
const params = new URLSearchParams(window.location.search)
const version = params.get(`gb-${experiment.key}`)
if (version) return
localStorage.setItem(`growthbook_experiment_${experiment.key}`, result.key)
window.analytics.track('Experiment Viewed', {
experimentId: experiment.key,
variationId: result.key
})
},
});
aloof-intern-85196
03/07/2024, 7:16 PMurl
as an attribute in our Growthbook SDK
• Toggled Visual Editor in the Growthbook app's SDK Configuration setting
• Added the Growthbook Chrome Extension
The docs have been very straightforward and simple. Not sure what I'm exactly missing 😅happy-autumn-40938
03/07/2024, 7:41 PMhappy-autumn-40938
03/07/2024, 7:43 PM<http://localhost:8001/>
. Is this the url you use to access the site?fresh-football-47124