Statistics on embeded code

I’m right now in the planning stage of a new RoR app that is pretty
simple, except for a stats problem I can’t get my head around on how to
do. Essentially clients have a photo display program that will be
displayed on their website. Visitors can then come to their site and
pull the embed code to post on their own site/blog. I’m trying to
figure out how to keep track on who (and how many) is embeding this into
their sites. I’ve never really worked with something like this before
and am trying to get pointed into the right direction (I’m still in the
planning stage).

Any suggestions?? or references?? be it in ruby??

-daniel