Send data from Segment to Avo Inspector (no code needed)
If you are already sending your data to Segment you can stream it to Avo Inspector without adding any code to your codebase.
You'll need to create a Segment Destination powered by Segment Function with a code snippet provided in your Avo workspace for each app and environment combination.
In Segment you usually have different sources for each app environment, for example if you have a single web app, you probably have Web App Dev and Web App Production sources in Segment.
Unlike Segment, Avo sources contain environments in them, so you will only need to create an Avo source per app, in our example you'll need a single Avo source called Web App.
After connecting your Segment Source to corresponding code snippet the event schemas of all events seen in Segment will automatically be sent to Avo Inspector and you'll be able to monitor the quality of your tracking implementation without any changes in your code!
Remember that production data takes up to 2 hours to appear in Inspector dashboard, while development data is available without any delay
This is the use case when you are not generating code with Avo.
You send data directly to Segment and it notifies Avo Inspector about your tracking plan taxonomy.
If you are using Avo Codegen and Avo generated code, see diagram of the data flow when using Avo Codegen.
An Avo Source is the first thing you need to connect your Segment data to Avo Inspector.
Sources in the Avo sidebar or
Manage Sources in Inspector tab
If you already have the source, pick it. If you don’t have the source corresponding to your app, add a new one.
In the source details, go to "Inspector Setup" and there you’ll see options to integrate Inspector. Pick Segment to see the integration code snippets.
Use the copy button to copy the full snippet to clipboard when you need to paste them into Segment on the next step.
Open Segment and log in into your workspace.
Connections -> Catalog -> Functions in Segment.
And press the
+ New Function button
We are interested in a destination function.
After creating a destination function you’ll find yourself in the web code editor provided by Segment. Here you would paste one of the code snippets we’ve seen in Avo on the 1st step. You'll need to create 2 separate segment functions for each code snippet, one for development and one for production.
Save it by pressing
Configure in the right bottom corner, filling the info in the next screen and pressing
Create 2 separate Segment functions for development and production environments
You can test the production Segment function in the same way, but keep in mind that the production data shows with a ~2 hours delay in Inspector dashboard, while development data is shown without delay
If you press “Use Sample Event” you’ll be able to pick one of the existing events that Segment saw in your workspace before.
Pick an event. Keep in mind that the reused Segment event will have the same timestamp as when it was originally fired, so we recommend to pick a recent event.
Press Run in the top right corner. The request will be executed. The result in Segment should look similar to this:
Then navigate to Avo,
Inspector and pick Development environment
And you’ll see the event in your dashboard under the source from where you got the snippet from. If you reused an old event from Segment you may need to switch to the 30 days time window in Inspector.
This means that the Segment function is working.
Go back to
Connections -> Catalog -> Functions in Segment. Pick the newly created Segment function and choose
+ Connect Destination in the sidebar.
Pick a source that would be analyzed by Avo Inspector and press
Confirm Source in the top right corner. Double check that you source and destination environments match.
Make sure to enable the destination using the toggle in the next screen
Now your Segment events stream to this source is analyzed by Avo Inspector.
Connect both development and production Segment Functions to your development and production Segment Sources.
This is the use case when you generate code with Avo.
You have an Avo file, represented by an Avo Source, in your codebase and send data to Segment with it. Then Segment notifies Avo Inspector about your tracking plan taxonomy.
Segment functions are billed by execution time. Learn the details here (opens in a new tab)