Avo Codegen alongside existing tracking

1 minute read

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 as "Implement with Avo" in the Avo workspace and they will appear as functions in the generated code.

Implement with Avo 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:

pseudocode
Copy
1
2
3
4
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 Avo"
  • Pulling the Avo code
  • Replacing existing SDK calls with calls of the generated Codegen