Event Rules

If you have set up a pixel (see Pixels Overview), you can set up rules to track or retarget users who perform actions resulting in events (such as purchasing a product or subscribing to a newsletter). See Create and Manage Rules for information on setting up rules.

Add an event type to track when a specific event occurs on your site. You can add standard events or custom events.

Add a Standard Event

If you choose Event Types as your rule type, you can create standard events. Create as many standard events as you like.

  1. From the New Rule page, select Event Types from the Rule Type dropdown list.
rule-type-drop-down-list
  1. Click the plus sign to add a new event.
click-the-plus-sign
  1. Make selections from the following dropdown lists to select the building blocks for the event.
Field Definition
Event Type Category. The object you want to track, such as clothes, electronics, or furniture.
  Action. The type of action the user takes with the category object, such as a clicking a button.
  Label. A label for the event details. For example, add an item to a shopping cart, place an order, make a request, or download a file.
  Value. A numeric value associated with the goal. For example, the number 10.
Rule Simple Rules (Equals, Less Than, Greater Than, Contains).
  Regular Expression (RegEx). For wildcard searches where conversions occur if the Value field contains any text string. Check out standard-event-regex-example.
Value A value you specify for each event type.
  1. Repeat Steps 2-3 until you have created all your events and your rule’s logic makes sense.

In the following example, a conversion occurs when a customer performs a button click event (by clicking the Add to Cart button) and adds a clothing product with a value greater than $10 to the shopping cart:

example-standard-events
  1. Click Save Rule.

Add a Custom Event

If you choose Event Types as your rule type, you can create as many custom events as you like.

  1. From the New Rule page, select Event Types from the Rule Type dropdown list.
rule-type-drop-down-list
  1. Click the plus sign to add a new event.
click-the-plus-sign
  1. Make selections from the following dropdown lists to select the building blocks for the event.
Field Definition
Key Your custom key, such as CustomerType, ProductID, or UserAction.
Rule Simple Rules: (Equals, Less Than, Greater Than, Contains).
  Regular Expression (RegEx). For wildcard searches where conversions occur if the Value field contains any text string. Check out custom-event-regex-example.
Value A value you specify for each event type.
  1. Repeat Steps 2-3 until you have created all your events and your rule’s logic makes sense.

In the following example, a conversion occurs when a customer completes an electronics product purchase of at least $100.

example-custom-events
  1. Click Save Rule.

Copy the Event Code to Use on a Website

If you create an event-based rule, there is an extra snippet of code you need to place on pages where that event can be tracked. You can generate the event code from the Pixels list view page.

To copy the event code to use on a website:

  1. On the Pixels page, locate the event rule from which you want to copy the javascript code.
  2. Click the code button next to the rule.
get-the-event-code-button

Note

Only event rules have a code button. URL rules do not.

You see the Get Event Code overlay.

get-event-code-overlay
  1. Click the Copy Tag button for the Javascript or Image code. For example:
copy-tag-button
  1. Paste the pixel code within the <head></head> tags on all relevant web pages from which you want to track events.
  2. When you are finished with the code overlay, click the Close button.

Regular Expression Examples

You can use regular expression (RegEx) event types for standard events or custom events.

Standard Event RegEx Example

For standard events, you can set up a building block to track when users browse for or purchase any product on a web site. To do so, select RegEx from the Rule dropdown list, and enter this wildcard logic in the Value field: ^[a-zA-Z0-9-.].

Your rule should look something like this:

standard-regex-event

Custom Event RegEx Example

For custom events, you can set up a building block to track when users browse for or purchase any product on a web site. To do so, select RegEx from the Rule dropdown list, and enter this wildcard logic in the Value field: ^[a-zA-Z0-9-.].

Your rule should look something like this:

custom-regex-event