This is the 2nd of a series of 3 blog posts covering our APIs, read the first one on the REST API here.
Flexible for Any Use Case
Measuring Offline Conversions
For businesses that have conversions that occur offline with channels such as direct mail, phone, or in-person, the Event API can help them understand the impact of how online experiments translate to conversions in the real-world. For instance, a bank could run an experiment to increase the prominence of their home loan products on their website and measure whether it increases home loan applications at their retail branches.
Working with Security Constraints
Enriching Your Conversion Data
In some cases, your company may want to supplement its conversion data with third party data. One potential application would be a travel company that generates revenue through affiliate conversions. Their customers search for travel options on their site but then purchase on a third party site (See image below). When running an experiment to generate additional traffic to their partner sites, they might want to understand whether those clicks also resulted in conversions on their partner sites. The Event API would help you bring that data into Optimizely to understand the true impact of your experiment. You can also use this to bring in metrics such as lifetime value from third-party BI systems to better understand the longer term input of your experiments.
Example: Travel Site Can Track Conversions on an Affiliate Site with Event API
Improved Performance and Capabilities
We’ve made a number of enhancements to our Events API based on learnings from our original offline events API. We’ve added the capability to batch events and we’ve also improved the performance and reliability. Optimizely X Web Snippets can now be enabled to use the Event API via a new logging endpoint, which enables batching of events and control over event timing.
Customers who are using the new endpoint have already seen a substantial increase in performance. If you are interested in getting access to the improved snippet endpoint, just submit a request for access. To confirm what endpoint you are currently using you can refer to the following article. For customers using our Full Stack SDKs, we’re also planning on rolling out updates to support batching in the future.
Send an Event
To send an event, you’ll just do a POST request to the Event API endpoint and pass it a JSON data object that includes information about your account, experiment, variation, decision, conversion event, and the visitor. For more detailed instructions, you can view the API reference here.
Decide if the Event API is Right for You
As a rule of thumb, if you have access to the conversion information at run-time and do not have any security restrictions that prevent you from firing the event, sending events via the snippet or SDKs is likely easier to set up and the better option. However, if the conversion meets any of the following criteria: occurs offline, isn’t available at run-time, needs to be augmented with other data sources then the Event API is likely the better fit.
However, it’s not necessarily a binary choice. In many cases, you could use the Event API in tandem with sending events through the snippet and SDKs to take advantage of more advanced tracking scenarios such as sending revenue through the snippet and lifetime value via the Event API.
Using the Event API to send events is straightforward:
- If you haven’t switched to Optimizely X, you’ll need to upgrade to Optimizely X.
- Read our developer docs on the Event API
- Begin sending events!
Take your experimentation to the next level!