amplitude / experiment-js-client

Amplitude Experiment client-side SDK for JavaScript
MIT License
7 stars 7 forks source link

Automatic $exposure tracking #55

Open joelr-cm opened 1 year ago

joelr-cm commented 1 year ago

Hello Amplitude SDK Team,

We are trying to implement Amplitude Experiments in our app but having trouble understanding how the automatic$exposure tracking works!

The docs say that the exposure tracking works automatically when using the SDK (we use version 1.5.3)

We need the $exposure to be tracked by Amplitude along with a custom event tracking provider.

Here is a snippet of how we initialize the SDK

AmplitudeExperiment.initialize(apiKey, {
  automaticExposureTracking: true,
  exposureTrackingProvider: new RudderStackExposureTrackingProvider(), // our custom provider
  debug:
    true,
  initialVariants: experiments.getAll().reduce(
    (variantsAcc, experiment) => ({
      ...variantsAcc,
      [experiment.id]: experiment.fallback,
    }),
    {}
  ),
});

We are unable to see the exposure events being tracked in Amplitude

image

We would appreciate any help with this.

Thank you Joel

bgiori commented 1 year ago

Hi @joelr-cm,

Thanks for submitting this issue.

First, if you debug or add log statements to the custom RudderStackExposureTrackingProvider is the track() method being called? If so what are the values in the Exposure object passed to track()?

Brian.