Use Twilio to track the effectiveness of your different marketing campaigns. Learn how call tracking helps organizations in these Twilio customer stories.
This project is configured to use a TwiML App, which allows us to easily set the voice URLs for all Twilio phone numbers we purchase in this app.
Create a new TwiML app at https://www.twilio.com/user/account/apps/add and use its Sid
as the TWIML_APPLICATION_SID
environment variable wherever you run this app.
You can learn more about TwiML apps here: https://www.twilio.com/help/faq/twilio-client/how-do-i-create-a-twiml-app
This project is built using the Ruby on Rails web framework. It runs on Ruby 2.2.3.
-
First clone this repository and
cd
into its directory:git clone git@github.com:TwilioDevEd/call-tracking-rails.git cd call-tracking-rails
-
Install the dependencies:
bundle
-
Export the environment variables: You can find the
AccountSID
and theAuthToken
at https://www.twilio.com/user/account/settings.export TWILIO_ACCOUNT_SID=your account sid export TWILIO_AUTH_TOKEN=your auth token
Also export the SID for the TwiML App you created above:
export TWIML_APPLICATION_SID=your twiml app sid
-
Create database and run migrations:
Make sure you have installed PostgreSQL.
rake db:setup
-
Make sure the tests succeed:
rspec
-
Run the server:
rails server
-
Check it out at http://localhost:3000
-
Test the API
curl -v --data "Cid=EE009a79-1a05-49d7-b876-2b884d0f825b&ClientUrn=g5-c-icewl2o8-nolan-real-estate-client&LocationUrn=g5-cl-53g6uec0q-twin-creek" http://localhost:3000/lease