Skip to content

Instantly share code, notes, and snippets.

@twerth
Created July 31, 2010 01:55
Show Gist options
  • Save twerth/501646 to your computer and use it in GitHub Desktop.
Save twerth/501646 to your computer and use it in GitHub Desktop.
Monitor GA events
#!/bin/bash
# Monitors your workstation's network, then reports anytime a GA event is tracked
# on any web page
# You must install ngrep to use. On OSX: sudo port install ngrep
# Change 'en0' to the device you want to to monitor ('en0' is the first ethernet card).
# Use 'ifconfig' to see what devices you have
sudo echo 'Monitoring GA events'
echo
echo '---------------------'
echo 'category*action*label'
echo '---------------------'
sudo ngrep -W byline -qld en0 'utmt=event' | grep 'utmt=event' --line-buffered | awk -F"[\(\)]" '{print $2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment