We will be using Snowplow Micro as a small replacement of a Snowplow pipeline for local testing. Snowplow Micro is a local Web server that lets you inspect tracked events.
You will need to have Docker installed. See the instructions here in case you don’t have it installed yet.
The following command can be used to run Micro using Docker:
docker run -p 9090:9090 snowplow/snowplow-micro:1.3.3
Additionally, you will need the Micro server to be accessible to your mobile devices or emulator VMs. The easiest way to achieve this is through the ngrok proxy that creates a publicly accessible URL for your local server. You can install ngrok on macOS using the following command (see here for installation options on other platforms):
brew install ngrok/ngrok/ngrok
You will need to sign up on the ngrok website and get an authtoken that you can then add to your ngrok installation using:
ngrok config add-authtoken <token>
Finally, you can start ngrok as follows:
ngrok http 9090
This will start the proxy and show you the “Forwarding” URL at which your Micro will be accessible (it has the format
Enter the forwarding URL in the
createTracker call in your app – see step 3 here
Build and run your app in an iOS simulator, Android emulator, or an actual device and use the app so that a number of events are tracked.
Navigate to http://localhost:9090/micro/all on your computer to see the number of tracked events. You should see a JSON with the counts of total, good, and bad events. Good events are events that passed validation while bad events resulted in validation errors when checking against their expected schema.
To inspect the good events in more detail, navigate to http://localhost:9090/micro/good .
In case there are bad events, you can inspect their validation errors at http://localhost:9090/micro/bad .