The Avo CLI includes a command, avo status
, which you can use ad-hoc or run in your CI to monitor that all expected analytics events are in fact implemented in your code.
avo status
?When you implement your analytics events with Avo Codegen, aka the type-safe analytics wrappers, you can run avo status
to check where in your code base the analytics calls are made, or if they are missing.
avo status
runs through your code base, searches for instances Avo Codegen, and returns an error if there is no found instance of one or more of the analytics events that are marked as "Implement with Codegen" for this code base.avo status
searches in the folder where it's invoked and in the children subfolders. It requires Avo to be initialized in that folder, i.e. your avo.json
file should be there.TerminalCopy> avo statusinfo Currently on branch 'main'└─ java android (musicplayerexample/src/main/java/sh/avo/Avo.java)├─ appOpened│ └─ used in musicplayerexample/src/main/java/app/avo/musicplayerexample/MusicPlayerExampleApplication.kt: 1 time├─ login│ └─ ✖ no usage found├─ logout│ └─ ✖ no usage found├─ pause│ └─ used in musicplayerexample/src/main/java/app/avo/musicplayerexample/ExampleMusicPlayerActivity.kt: 1 time├─ play│ └─ used in musicplayerexample/src/main/java/app/avo/musicplayerexample/ExampleMusicPlayerActivity.kt: 3 times├─ playNextTrack│ └─ used in musicplayerexample/src/main/java/app/avo/musicplayerexample/ExampleMusicPlayerActivity.kt: 1 time└─ playPreviousTrack└─ used in musicplayerexample/src/main/java/app/avo/musicplayerexample/ExampleMusicPlayerActivity.kt: 1 timeinfo 5 of 7 events seen in codeerror 2 missing events└─ java android (musicplayerexample/src/main/java/sh/avo/Avo.java)├─ login: no usage found└─ logout: no usage found
Get in touch if you want to learn more about how Avo prevents analytics errors.
💡 Why would I add Avo to my CI/CD?
Adding
avo status
to your CI/CD enables you to regression monitor your implementation (i.e. confirm you haven't accidentally refactored out an analytics trigger), as well as confirm that you've implemented every analytics event that should be implemented for a specific analytics release in a specific codebase.
avo status
in GitHub ActionsAdd this script to .github/workflows/avo_status.yml
.
It will take care of installing the Avo CLI and running the avo status
check on your codebase every time new changes are pushed.
TerminalCopyname: Avo Statuson: pushjobs:build:runs-on: ubuntu-lateststrategy:matrix:node-version: [16.x]steps:- uses: actions/checkout@v2- name: Use Node.js ${{ matrix.node-version }}uses: actions/setup-node@v1with:node-version: ${{ matrix.node-version }}- name: Install Avo CLIrun: npm install -g avo- name: Avo statusrun: avo status