Type safe code, unit tests and CI
Guides
Avo and Existing Tracking

Avo Codegen alongside existing tracking

You can safely keep raw tracking calls in your code when adopting Codegen. In this case we recommend to migrate gradually, following 2 steps below.

1. Start implementing all new tracking with Codegen.

Mark the new events you want to implement with Avo Codegen as "Implement with Codegen" in the Avo workspace and they will appear as functions in the generated code.

Implement with Codegen checkbox example

Initiate Codegen with a destination interface.

In the track methods of the destination interface (logEvent, identify etc.) you use your existing tracking SDK instance to track events:

logEvent(eventName, eventProperties) {
    // Log event in your destination
    analytics.track(eventName, eventProperties)
}

With this one time setup the events you track with Codegen will be sent to the same analytics destinations as your existing events.

2. Migrate you existing implementation to Avo

Going forward you'll be able to gradually swap old events implemented with raw analytics SDK with Avo implementation at your own pace by:

  • Marking more events as "Implement with Codegen"
  • Pulling the Avo code
  • Replacing existing SDK calls with calls of the generated Codegen