Dimensions and metrics are vital components to reports. The events
variable is responsible for data collection of many metrics on your site. Events typically increment metrics in reports.
Before implementing events, make sure that you create and configure them under Success events in Report suite settings. If you plan to use custom events in link tracking hits, make sure that linkTrackVars
and linkTrackEvents
are set correctly.
If using the XDM object, custom events use the following XDM fields:
xdm._experience.analytics.event1to100.event1
- xdm._experience.analytics.event1to100.event100
.xdm._experience.analytics.event101to200.event100
- xdm._experience.analytics.event101to200.event200
.xdm._experience.analytics.event901to1000.event901
- xdm._experience.analytics.event901to1000.event1000
. eventx.value
is used to specify the amount to increment. eventx.id
is used for serialization.xdm.commerce.purchases.value
.productListItems[].quantity
fields.productListItems[].priceTotal
fields.xdm.commerce.productViews.value
.xdm.commerce.productListOpens.value
.xdm.commerce.productListAdds.value
.xdm.commerce.productListRemovals.value
.xdm.commerce.productListViews.value
.xdm.commerce.checkouts.value
.If an event is set under productListItems
(for example, productListItems._experience.analytics.event1.value
) and that event is not yet in this field, that event is automatically added to this field.
If using the data object, all events use data.__adobe.analytics.events
, following AppMeasurement string syntax. If you set this field, any events set in the XDM object are overwritten and not sent to Adobe Analytics.
You can set events either while configuring the Analytics extension (global variables) or under rules.
Several features are available:
event1
under the drop-down list and including 10
in this field increments event1
by 10 in reporting.The s.events
variable is a string that contains a comma-delimited list of events to include in the hit. The variable allows up to 64k bytes, effectively allowing as many events as a hit needs. Valid values include:
event1
- event1000
: Custom events, set however you’d like. Record how you use each event in your organization’s solution design document. The number of available events depends on your organization’s Analytics contract. Most organizations on non-legacy contracts have 1000 custom events available. Contact your Adobe Account Team if you are not sure how many custom events are available to you.purchase
: Increments the ‘Orders’ metric by 1, and takes values set in the products
variable to calculate ‘Units’ and ‘Revenue’. See purchase event for more information.prodView
: Increments the ‘Product Views’ metric.scOpen
: Increments the ‘Carts’ metric.scAdd
: Increments the ‘Cart Additions’ metric.scRemove
: Increments the ‘Cart Removals’ metric.scView
: Increments the ‘Cart Views’ metric.scCheckout
: Increments the ‘Checkouts’ metric.This variable is case-sensitive. Avoid mis-capitalizing event values to ensure accurate data collection.
// Set the events variable to a single value
s.events = "event1";
// Set the events variable to multiple values
s.events = "event1,event13,purchase";
You can count custom events more than once if desired. Assign an integer to the desired event within the string. Events created in report suite settings are counter events by default.
// Count event1 ten times
s.events = "event1=10";
// Count event1 twice and event2 once
s.events = "event1=2,event2";
Counter events do not support currency or decimal values. Use currency events for currency, or numeric events for decimal values.
You can change a custom event to use currency instead of integers. Currency events automatically convert to the report suite’s currency if the report suite currency and the currencyCode
variable do not match. They are useful to help calculate shipping costs, discounts, or refunds. You can set currency events in the products
variable if you want to attribute the event to only that product.
Before implementing currency events, make sure that you set the desired event to ‘Currency’ under Success events in Report suite settings.
// Send $9.99 USD in event1 using the events variable. Make sure the event type for event1 is Currency in Report suite settings
s.currencyCode = "USD";
s.events = "event1=9.99";
// Send $9.99 USD in event1 using the products variable. Make sure the event type for event1 is Currency in Report suite settings
s.currencyCode = "USD";
s.events = "event1";
s.products = "Example category;Example product;1;0;event1=9.99";
If you set a currency value in both the events
variable and the products
variable, the currency value in events
is used. Avoid setting currency values in both the events
and products
variables.
You can change a custom event accept decimal values instead of integers. Numeric events behave similarly to currency events, except they do not use currency conversion. You can set numeric events in the products
variable if you want to attribute the event to only that product.
Before implementing numeric events, make sure that you set the desired event to ‘Numeric’ under Success events in Report suite settings.
// Send 4.5 in event1 using the events variable. Make sure the event type for event1 is Numeric in Report suite settings
s.events = "event1=4.5";
// Send 4.5 in event1 using the products variable. Make sure the event type for event1 is Numeric in Report suite settings
s.events = "event1";
s.products = "Example category;Example product;1;0;event1=4.5";
If you set a numeric value in both the events
variable and the products
variable, the numeric value in events
is used. Avoid setting numeric values in both the events
and products
variables.