Hi all I was wondering, has anyone tried using Gro...
# ask-questions
Hi all I was wondering, has anyone tried using GrowthBook with https://getanalytics.io/ ? I have the basic setup working but I'm running in to trouble setting up experiments with the GrowthBook
. 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?
Hi Colin, looking into it
it looks like getAnalytics has a custom event function:
Copy code
analytics.track('experiment_viewed', {
  experiment_id: ...
  variation_id: ....
ah yeah so hold on I'll show you what I'm trying here:
Copy code
const growthbook = new GrowthBook({
  apiHost: "<https://cdn.growthbook.io>",
  clientKey: "XXXXXX",
  enableDevMode: true,

const analytics = Analytics({
  app: "experiment-testing",
  plugins: [
      token: "XXXXXX",
      options: {
        loaded: (mx) => {
            id: mx.get_distinct_id(),
  debug: true,
you’re using getAnalytics to track events to mixpanel?
so tracking events in components come from a track hook in analytics (it has a provider that wraps my app component taking the above
instance similar to the Growthbook one
oh wait, I can just call the tracking event manually on app startup right 🤦
ok i feel silly now 😄
thanks @fresh-football-47124 that makes sense. I was thinking this event needed to be passed into the callback at growthbook instance creation.