Saturday, January 23, 2010

Graphing Affiliate Sales On Clickbank With Ruby

Here's my recent affiliate sales on ClickBank. I'm not yet a gazillionaire.

I've got two sites selling two ebooks, and I wanted to know which ones were making me money (relatively speaking). I hacked some code to generate this graph:

Here's the code (on GitHub).

It's extremely hacky, and obviously the graph lacks a lot of useful context, but it paints a very clear picture of which of my two sites is doing better than the other. Even in its current, crappy hack status, it's good enough to get the job done, and in a few months' time, if I start selling a few more products on ClickBank, this little script is going to prove very handy. All I need to do is add date labels and I've got something I can cross-reference against Google Analytics.