Skip to main content
menu_icon.png

Everything you need to switch from Optimizely Classic to X in one place: See the Optimizely X Web Transition Guide.

x
Optimizely Knowledge Base

Check event firing in a live experiment or campaign

This article is about Optimizely X. If you're using Optimizely Classic, check this article out instead.
 
relevant products:
  • Optimizely X Web Experimentation
  • Optimizely X Web Personalization
  • Optimizely X Web Recommendations

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

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, fire the event you'd like to check.

  3. In the filter field, enter event. Look for a Method of POST with a status of 200. 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.

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.

    • However, for custom events, if you specified a category when creating the event, that category value will be returned instead of the string other.

  • layerStates

    • Lists the campaign that an event is attached to.

    • Expand one of the numbered objects underneath layerStates to see the layerId (experiment ID) and decision (variation ID) to which the event is attached.

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