famous-vegetable-72890
01/27/2023, 4:11 PMtrackingCallback
. Because of the way Analytics works I don't have direct access to the track methods at the point where I'm creating the GrowthBook instance. Does anyone know a work-around?fresh-football-47124
analytics.track('experiment_viewed', {
experiment_id: ...
variation_id: ....
....
})
famous-vegetable-72890
01/27/2023, 4:13 PMconst growthbook = new GrowthBook({
apiHost: "<https://cdn.growthbook.io>",
clientKey: "XXXXXX",
enableDevMode: true,
});
const analytics = Analytics({
app: "experiment-testing",
plugins: [
mixpanelPlugin({
token: "XXXXXX",
options: {
loaded: (mx) => {
growthbook.setAttributes({
...growthbook.getAttributes(),
id: mx.get_distinct_id(),
});
},
},
}),
],
debug: true,
});
fresh-football-47124
famous-vegetable-72890
01/27/2023, 4:15 PManalytics
instance similar to the Growthbook one