Nearly a year ago, I was working on a new feature for an app powered by Twilio when I realized that it would be significantly easier to get started with Twilio’s TwiML if hosting an XML file could be removed from the equation. Several weeks ago, Twimlbin was born. One of the features we needed to implement quickly was the ability to track calls both as a pageview and an event in Google Analytics. After building this feature, we found it more and more useful for many other call tracking instances. With this feature and the TwiML <Redirect> secondary verb, it’s possible to use Twimlbin as a basic analytics proxy – something we find incredibly useful. Simply create a new Twimlbin with the code below or clone this bin and replace the URL with your app’s location.
<Response> <Redirect>http://www.example.com/twilio_app.php</Redirect> </Response>
Once you’ve setup the Twimlbin, simply paste in your Google Analytics ID and you’re ready to go. You can even watch calls in realtime with the new Google Realtime Analytics feature.