There are cases where you’ll want to record a KISSmetrics event but will not have access to Javascript or other server-side languages. The primary examples are ad campaigns and e-mail campaigns. In order to track these kinds of events you can embed what is known as a beacon. A beacon is simple a 1x1 pixel invisible image that you can include in your e-mail or ad campaign. When this beacon (image) is requested KISSmetrics will record the event for you. Be forewarned that many e-mail clients automatically block these images so your reported numbers will be lower than your actual views.
Let’s put it all together in an example:
<img src="http://trk.kissmetrics.com/e?_k=YOUR_KEY&_n=Viewed+E-mail&
_p=john@smith.com&email_variation=Big+Red+Button"/>
As you can see the beacon is just a standard img tag. Your beacon must point to trk.kissmetrics.com (both HTTP and HTTPS are supported). To record an event the path of the URL must be /e. Next we include our required parameters (_k, _n, and _p) and then our optional parameters (in this case email_variation).
Please note that the Beacon is not a replacement to our JavaScript API. It does not do any identity management through cookies, which is why you have to include within the beacon the identity of the person who is performing the event.
For information on the structure for the beacon URL, please see our API Specifications.
Filed under APIs