What's your biggest current challenge? Have your say in Community Polls along the right column.

How can I capture custom events using Rudderstack?

How can I capture custom events using Rudderstack?

makescence
Visitor
1 0 0

Dear Community

I am trying to set-up and experiment using Growthbook and capturing events using Rudderstack.

Have added a custom event in theme-liquid.

Based on this https://docs.growthbook.io/lib/script-tag
However the custom events is not captured. 

 

 

<script>
window.growthbook_config = window.growthbook_config || {};
window.growthbook_config.trackingCallback = (experiment, result) => {
  window.rudderanalytics.track("Viewed Experiment", {
    experiment_id: experiment.key,
    variation_id: result.key
  })
};
</script>

 

 

 

The error is that the object rudderanalytics is not defined at time of invocation of the call.
Which javascript file should this code snippet live?

Replies 0 (0)