This message was deleted.
# announcements
w
This message was deleted.
f
Are you using analytics.js V2 or the old analytics.js from segment?
f
We'll be implementing V2 in the next week or so
f
In that case, you can use the new middlewares feature. Something like this:
Copy code
analytics.addSourceMiddleware(
  function({ payload, next, integrations }) {
    const experiments = [];
    growthbook.getAllResults().forEach(function({experiment, result}) {
      experiments.push(experiment.key + "::" + result.variationId)
    });
    payload.obj.experiments = experiments;
    next(payload);
  }
)
141 Views