Skip to main content
menu-icon.png

 

x
Optimizely Knowledge Base

Check event firing in a live experiment or campaign

THIS ARTICLE WILL HELP YOU:
  • Check that events in a live experiment or campaign fire when you expect

This article is relevant for Web projects which have been configured to use /event logging endpoint.  Follow these instructions to identify the logging endpoint used by your snippet. 

The network panel is a log in your browser that records events that occur as you interact with a page. When you trigger an event in Optimizely X it fires a tracking call, which is picked up in the network traffic.

Here's when network traffic is useful:

  • You see few or no metrics on your Results page and want to check whether events are firing

  • You want to QA a custom event that requires the visitor to take an action beyond just a click (like a revenue event)

This article shows you how to use the console to check whether an event is firing in a live experiment or campaign.

Want to check event firing in a draft experiment or campaign? Use the Preview tool.

1. Check cross-origin settings

An “origin” is a combination of a specific hostname, protocol, and port on your site. By default, events that you track in Optimizely can only be used to target changes on the same origin. So when the snippet is running on https://shop.example.com, it can access events that were generated on https://shop.example.com, but it cannot access events that were generated on:

Here's how to enable cross-origin targeting to track events across domains.

2. Open the network panel

  1. Right-click on the page. From the dropdown menu, select Inspect in Chrome or Inspect Element in Firefox. 

  2. Select the Network tab.

  3. Click the filter icon (it should turn blue).

  4. Select XHR.

  5. Click to fire the event you'd like to test.

Check out this article for more details on how to quickly access the developer console.

3. Check event firing 

  1. In the open network tab, make sure the filter icon is checked (blue), XHR is selected, and type "event" to filter your results.

  2. In your browser, take the action to fire the event you'd like to check.

  3.  Look for a Request Method of POST with a status of 204. This means that Optimizely has logged an event in its counting infrastructure.

  4. Select one of these POST events. Click the Headers tab and scroll to the Request Payload section. Click to expand it to see more detail.

  5. To view, the details of the event open the nested objects as shown below.  Events are within the snapshots object  

    event_payload.png

 

Here are some items you may see in the request:

  • eventName 

    • For click and custom events, the api_name of the event is returned.

    • For pageview events, the page ID is returned. 

    • If strings of numbers are returned, descriptive names are masked in your project. Use API Names to match names to IDs.

  • eventType

    • For the first activation of the snippet, the string client_activation is returned.

    • For pageview events, the string view_activated is returned.

    • For click and custom events, the string other is returned.

  • layerStates

    • Lists the campaign that an event is attached to.

    • Expand one of the numbered objects underneath decisions to see a list of experiments or campaigns you were exposed to.

      • What do the letters in each object represent?

        • c - Campaign ID or layer ID

        • h - Indicates whether you are in the experiment holdback for personalization campaigns or did not meet the experiment level traffic allocation settings in AB tests.

        • x - Experiment ID for AB tests and Experience ID for Personalization campaigns

        • v - Variation ID

    • If strings of numbers are returned, descriptive names are masked in your project. Use API Names to match names to IDs.

A null value for the Experiment ID and Variation ID, represented by x and v respectively in the network call, means that you no longer qualify for an experiment. As a result, your conversion will not be counted. Click here to read more about how we count conversions.

For more information about what is included in the request payload, see our developer documents on Event API- Log Endpoints.