It’s currently hour 23 of 24 for RJMetrics’ third hackathon, and I’ve officially built, tested, and deployed a brand new RJMetrics data connector on our beta Data Import API. It sucks down data from our marketing automation platform, Pardot, and updates my RJMetrics dashboards on an hourly basis.
This is exciting for several reasons:
- We now have a functional, close-to-release version of the Data Import API. This API will become the new standard for how data gets pushed to RJMetrics.
- The API is dead simple to integrate with. I am not a “real” developer and I was able to build an incredibly useful connector in 1 day using Ruby and deploying on a completely free Heroku instance.
- The dashboards that I use every day are now auto-updated without me having to lift a finger. This will save me several hours every week.
The Data Import API
We’ve kept our Data Import API a state secret to this point so as not to incite the mob—a lot of you have been waiting for this for a long time. But we’re close to launch, so I figured I’d let the cat out of the bag. Here’s the lowdown.
The RJMetrics Data Import API is an incredibly straightforward way to import data into your RJMetrics account. In fact, that’s all it does. Send it data, and it saves that data to a table in your account. Just make sure your data includes an ID field and is formatted as JSON and you’re good to go. Once you push data, it will become available for you to use in metrics and dashboards.
This means you can now integrate anything with RJMetrics. Customer support platform? Check. Inventory management platform? Check. CRM? Check. Custom application developed by Fred from your IT department? Check. Every aspect of your business can now be seamlessly integrated into your cloud business intelligence solution.
Building Your Connector
The logic of a connector is incredibly easy:
- Identify a data source
- Select all the rows
- Push them to the Data Import API
The wonderful thing about this logic is that you don’t have to track what rows are new, old, updated, etc. Just push all the rows across. Our warehouse will match records by ID and perform inserts and updates as appropriate. Much less for you to worry about.
If you have many millions of rows in a given table, you may want to include logic to only push certain of those rows. The dataset that I was using was small enough that this wasn’t a concern.
Copy My Connector
If you develop in Ruby, you’re more than welcome to use my code as a starting point for developing your own connector. I wrote a (very) simple API wrapper that is bundled as a gem for easy inclusion. Include it in your gemfile by adding:
gem 'ruby_rjmetrics', :git => 'https://github.com/jthandy/ruby_rjmetrics.git'
Don’t feel like you have to use the gem, though. If you want to see how the API call is made, it’s really just 1 line:
The connector itself is a simple Rails app with no persistence layer, deployed on Heroku. There is a single controller for each type of data that’s responsible for getting data. The controllers are then called as rake tasks from the command line, allowing them to be easily integrated into cron (or the Heroku scheduler).
Again, feel free to steal all of the code, or use it as a jumping-off point. It’s quick and dirty, but it does the trick. Get it here.
If I can do it, you can too
I’m a marketer. I write some code every once in a while, but our developers here would never let me within a mile of the RJMetrics code base. So, when I say I wrote a connector, that means that you probably can too.
We’re now accepting applicants to participate in the closed beta of the Data Import API. If you’d like to participate, just contact support.

