This blog post continues the previous blog on the ODP (Optimizely Data Platform) implementation.

ODP by default provides a lot of tracking events. You can explore these by going to

Settings -> Objects & Fields

However, you can create your own events. For example, the customers on my website add funds to their online wallets before making any purchase. I want to capture the “Add-Funds” event so I use this event information in my reports.

Optimizely developer documentation given event tracking example as below

zaius.event("your_event_type_here", { 
    action: "your_event_action_here",
    example_custom_field: "example_value"
});

Essentially you can name events however you like but Optimizely has added two parameters to categorize events.

Event type: High-level category of event such as Products

Action: Action that the user needs to perform such as Add to cart

Field: This will be the data you want to track such as product price.

Based on the above example my custom tracking code will be as follows

zaius.event("Wallet", { 
    action: "Add-Funds",
    amount: "10.00"
});

When the user adds funds to their wallet this event fires and sends information to ODP. You can track it in the event inspector as well.

You can add other association information with this event as well like email addresses. The associated information will be sent to ODP with the same event. Based on the email address the event will be associated automatically with customer profile information in ODP. So you can use it in segmentation and reporting.

You need to make sure the event field is a valid field from the “Object” list (see the above screenshot). Otherwise, the event gets tracked and you can see it in the event inspector but it would not get saved for reporting. you can add more fields on this screen as well.

Categorized in: