API Tips

Event and Property Names/Renaming

You do not have to predefine events or properties in the KISSmetrics website. Simply start passing them in and they will be available within your reports within 1-3 hours. Both event and property names are case insensitive. So setting the property foo is the same as the property Foo. If this is a new property or event KISSmetrics will try to come up with a good display name using simple replacement and capitalization. So your property shirt_color will be displayed as Shirt color within the KISSmetrics reports. You can edit the displayed name by clicking the Edit Site button in the sidebar under your Site Settings and clicking on the “Events” tab.

We recommend using descriptive event names as they will make more sense when you pull up your reports. So instead of sent_inv we recommend Sent Invite. We also suggest you name your events as past-tense verbs. So instead of naming an event Homepage we recommend something like Viewed Homepage. This will make your reports more readable in KISSmetrics. You can always edit these names later.

No matter what the display name is it is very important that you use the same name within your code consistently. So if for example you later decide you want to call the property T-Shirt Color in your reports you should change this name from within the KISSmetrics website (by clicking the Edit Site button in the sidebar under your Site Settings and clicking on the “Events” tab). However, in your code you would still use shirt_color. If you change your code to tshirt_color, KISSmetrics will think it is a new property, which is probably not what you want.

Data Types

KISSmetrics determines the type of property based on the value, not on the data type. So if you pass in a string "123", KISSmetrics will treat that as the integer 123 Do not use currency symbols or other non-numeric characters when passing in numeric data. KISSmetrics will treat "$100" as the string "$100", not the integer 100. Likewise with "100 USD". Most likely you’ll want KISSmetrics to treat such a value as a number so you’ll want to pass in just the numeric values (so just 100 or "100").

Validation, Return Values and Debugging

The KISSmetrics tracking API will always return an invisible 1x1 GIF. This is because our Javascript API and Beacon API rely on having an image returned. If you pass in a malformed-URL the API will not give you an error code. It will always return with HTTP 200 OK. This is because we don’t want errors to display to end-users for our customers who are using our Javascript API. Currently your only options for validating that you are doing things correctly are:

  1. Check your data within the KISSmetrics report
  2. Use Live

Other

Please see our FAQ for other common questions.


Filed under APIs

Search


Learn more about KISSmetrics

Get started now