Some of your business’s key interactions with customers may happen offline. Sample “offline events” can include…
These events don’t happen as a result of the customer visiting your website. There are alternate ways to bring in this data, using our other APIs.
If you have a server that logs when such events occur, you can use one of our server-side APIs to register when the events occur. It would be somewhat similar to the process of Importing Existing Data.
If you don’t have a server dedicated for this purpose, you can still record one-off instances by visiting the KISSmetrics tracking URL that describes your event. The trickiness is in making sure that the tracking URL is set up perfectly. I will be referring to the tracking URL structure as described in API Specifications.
I’ve just closed a deal over the phone (offline) with bob@bob.com, who has just purchased an item from me for $5000. I visit this URL to record that the event happened.
http://trk.kissmetrics.com/e?_k=foo&_n=Purchased&_p=bob%40bob.com&Billed+amount=5000
Let’s walk through what makes up each of the components of the URL:
http://trk.kissmetrics.com/e?: the base part of the tracking URL. /e indicates you’re recording an event, and the ? precedes the rest of the parameters you’ll pass in…_k=foo: tells us to use the API key “foo”. Make sure you use your own API key, found on the KISSmetrics settings page.&_n=Purchased: the event name is Purchased. (The & is there to separate the components of the URL.)&_p=bob%40bob.com: the person who Purchased was “bob@bob.com”. The @ is represented by %40 because special symbols needed to be encoded in a URL. Please refer to this reference on URL encoding.&Billed+amount=5000: pass in an additional property “Billed Amount”, set to “5000”. Again, the space between “Billed” and “Amount” is represented by + because of URL encoding.So to put it all together, visiting the above URL indicates that “bob@bob.com” did “Purchased” with a “Billed Amount” of “5000” at the time that you visited the URL. You can optionally pass in the _t and _d parameters to specify the time that the event actually occurred – please refer to API Specifications. If you have KM Live open, you would see this event come through successfully.
In line with our API Specifications, you can make a URL that goes to http://trk.kissmetrics.com/e with the following parameters:
_k is your API Key._n is the Name of the Event to record._p is the identity of the person doing the event. Remember to URL encode any emails (ie. @ should be represented as %40)_t and _d specify the time that the event occurred.We highly recommend you test this out a few times using KM Live. Please contact support with any further questions!
Filed under How To's, Examples, and Best Practices