By configuring Shop Action tag attributes, you can capture additional event attributes that are not included in the default tag attribute configuration, from Digital Analytics to Campaign.
Shop Action 5 tag
The shop Action 5 tag captures data about selected products and what products are present in a shopping cart, if any, when the cart is viewed. When a visitor selects a product or views a shopping cart with carted products, a Shop Action 5 tag is called for the selected product or each displayed carted product. The Shop Action 5 tag also reports information about the products such as Product ID, quantity, and price.
The Shop Action 5 tag captures data about selected products and which products are present in a shopping cart, if any, when the cart is viewed.
When a visitor views a shopping cart with carted products, a Shop Action 5 tag should be called for each displayed carted product including information about the products such as Product ID, quantity, and price. In cases where a visitor can select or cart a product without actually being directed to the cart page, a single Shop Action 5 tag should also be called for the product just added. For linear purchase or application processes without a 'cart', the Shop Action 5 tag should be sent when the product is 'selected'. Typically this occurs at the earliest point in time when the selected product ID, unit price, and unit quantity values are known.
Key reports populated
- Dashboards (commerce overview)
- Site metrics
- Products (all)
- Paths
- Demographics
- Profile segments
- Report segments
Digital data exchange object example
digitalData = {
page:
{
pageInfo:
{
pageID:'CART',
onsiteSearchTerm:'',
onsiteSearchResults:''
},
category:
{
primaryCategory:'CHECKOUT'
},
attributes:
{
exploreAttributes:'',
extraFields:''
}
},
cart:
{
item:new Array()
}
};
digitalData.cart.item[0] = {
productInfo:
{
productID:'productID123',
productName:'productName123'
},
quantity:'1',
price:'9.99',
category:
{
primaryCategory:'',
virtualCategory:''
},
attributes:
{
exploreAttributes:'',
extraFields:''
}
};
digitalData.cart.item[1] = {
productInfo:
{
productID:'productID456',
productName:'productName456'
},
quantity:'1',
price:'9.99',
category:
{
primaryCategory:'',
virtualCategory:''
},
attributes:
{
exploreAttributes:'',
extraFields:''
}
};
Tagging function
To use the shop action 5 tag, a call is made to cmCreateShopAction5Tag(…). This call should be made for the product selected or for each product viewed in the cart.
In addition to these function calls, you must also make a single call to the function cmDisplayShops() at the end of the sequence of 1 or more cmCreateShopAction5(…) tags. This function evaluates the shop action 5 tag data and performs any needed client side aggregation of identical products. The ShopAction5 data collection image request(s) are sent only when the cmDisplayShops() function is called.
Parameter | Required | Description | Length |
---|---|---|---|
Product ID | Required | Product ID | 256 |
Product Name | Required | Name of the product in the cart. | 256 |
Quantity | Required | Quantity of this product currently selected or viewed in a cart.
For Travel this is typically the # of tickets selected for a given trip or event, the # of items selected for a given rental-product, or the # or room-nights selected for booking in the hotel. For Financial Services applications this is typically "1", if only 1 quantity is applicable to a given financial product. |
8 |
Unit price | Required | Price of each unit of the product. This value should be a decimal number and should not include a dollar sign ($).
For Travel this is typically the price for a given route or event ticket, rental product, hotel room/night price, etc. For Financial Services applications this is usually "0" if no revenue value is associated with the application. |
16.2 |
Category ID | Optional | Category ID for the leaf node to which this product belongs. This should match with a category ID sent in the CDF file. | 256 |
Attribute string | Optional | Up to 50 "-_-" delimited 'attribute' values accessible in Explore reporting. Shop Action 5 and 9 tags both share the same 50 attributes. See Appendix D for more details. | 256 per value |
Extra fields | Optional | Up to 15 "-_-" delimited 'extrafield' values accessible through optional Standard Data Export. It is possible to copy the first 15 values from the first 15 Attribute String values by calling cmSetupOther ({"cmAutoCopy AttributesToExtra Fields" :true}); on the page prior to tag function calls. | 100 per value |
Examples
The following example shows shop action 5 tags being sent for a couple of products on the Cart page:
<head>
<script type="text/javascript" src="//libs.coremetrics.com/eluminate.js">
</script>
<script type="text/javascript">
cmSetClientID("99999999",true,"data.coremetrics.com","thesite.com");
</script>
</head>
<body>
...
<script type="text/javascript">
cmCreatePageviewTag("Cart", "CART");
// A separate call to cmCreateShopAction5Tag should be made for each cart entry
cmCreateShopAction5Tag("12345", "Product X", "2","5000.42","CATXYZ");
cmCreateShopAction5Tag("67890", "Product Y", "1", "10.95", "CATABC");
cmDisplayShops();
</script>
</body>
Shop action 9 tag
The shop action 9 tag captures data about what products were purchased by a customer. Like the shop action 5 tag, one tag must be sent for each product line item purchased. These tags must be sent on the receipt or other completion page that confirms a successful order.
Key reports populated
- Dashboards (Commerce overview)
- Site metrics
- Products
- Paths
- Demographics
- Profile Segments
- Report Segments
Digital data object example:
digitalData = {
page:
{
pageInfo:
{
pageID:'ORDERCONFIRMATION',
onsiteSearchTerm:'',
onsiteSearchResults:''
},
category:
{
primaryCategory:'CHECKOUT'
},
attributes:
{
exploreAttributes:'',
extraFields:''
}
},
user:
[
{
profile:
[
{
profileInfo:
{
profileID:'REGISTRATION-ID',
profileEmail:'EMAIL@EMAIL.COM',
exploreAttributes:''
},
address:
{
city:'CITY',
state_province:'STATE_PROVINCE',
postalcode:'POSTALCODE',
country:'COUNTRY'
}
}
]
}
],
transaction:
{
transactionID:'123',
total:
{
basePrice:'19.98',
shipping:''
},
profile:
{
profileInfo:
{
profileID:'REGISTRATION-ID'
},
address:
{
city:'CITY',
state_province:'STATE_PROVINCE',
postalcode:'POSTALCODE'
}
},
attributes:
{
exploreAttributes:'',
extraFields:''
},
item:newArray()
}
};
digitalData.transaction.item[0]={
productInfo:
{
productID:'productid123',
productName:'productName123'
},
quantity:'1',
price:'9.99',
category:
{
primaryCategory:''
},
attributes:
{
exploreAttributes:'',
extraFields:''
}
};
digitalData.transaction.item[1]={
productInfo:
{
productID:'productid456',
productName:'productName456'
},
quantity:'1',
price:'9.99',
category:
{
primaryCategory:''
},
attributes:
{
exploreAttributes:'',
extraFields:''
}
};
Tagging function
In order to use shop action 9 tags, a call is made to cmCreateShopAction9Tag(…)
for each product purchased. In addition, a single call to cmDisplayShops()
must be made after all calls to cmCreateShop9Tags(…)
in order to send one or more data collection image requests.
Parameter | Required | Description | Length |
---|---|---|---|
Product ID | Required | Product ID | 256 |
Product Name | Required | Name of the product | 256 |
Quantity | Required | Quantity of this product purchased.
For Travel this is typically the number of tickets that are purchased for a given trip or event, the # of items rented for a given rental-product, or the number or room-nights booked for this hotel. For Financial Services applications this is typically "1", if only one quantity is applicable to a given financial product. |
8 |
Unit price | Required | Price of each unit of the product. This value must be a decimal number and must not include a dollar sign ($).
For Travel this is typically the price for a given route or event ticket, rental product, hotel room/night price, and so on. For Financial Services applications this is usually "0" if no revenue value is associated with the application upon completion. |
16.2 |
Registration ID | Required | Registration ID for the customer who purchased the product. This must match the Registration ID field in the accompanying Order Tag. | 256 |
Order ID | Required | Order ID for the order to which this line belongs. This must match the Order ID in the accompanying Order Tag. | 64 |
Order subtotal | Required | Subtotal for the order to which line item belongs. This must not include Shipping and Handling or Tax and must match the Order Subtotal in the accompanying Order Tag. This value must be a decimal number and must not include a dollar sign ($).
The Order Subtotal must match the sum of Quantity * Unit Price for all ShopAction9 tags (products) purchased in this order. |
16.2 |
Category ID | Optional | Category ID for the leaf node to which this product belongs. This must match with a category ID sent in the CDF file. | 256 |
Attribute string | Optional | Up to 50 "-_-" delimited 'attribute' values accessible in Explore reporting. Shop Action 5 and 9 tags both share 50 attributes. See Additional Tag Attributes for for more details. | 256 per value |
Extra Fields | Optional | Up to 15 "-_-" delimited 'extrafield' values accessible through optional Standard Data Export. It is possible to copy the first 15 values from the first 15 Attribute String values by calling cmSetupOther ({"cmAutoCopy AttributesToExtra Fields":true}); on the page prior to tag function calls. |
100 per value |
Example:
Up to 15 "-_-" delimited 'extrafield' values accessible through optional Standard Data Export. It is possible to copy the first 15 values from the first 15 Attribute String values by calling cmSetupOther ({"cmAutoCopyAttributesToExtraFields":true});
on the page prior to tag function calls.
<head>
<script type="text/javascript" src="//libs.coremetrics.com/eluminate.js"></script>
<script type="text/javascript">
cmSetClientID("99999999",true,"data.coremetrics.com","thesite.com");
</script>
</head>
<body>
...
<script type="text/javascript">
cmCreatePageviewTag("Order Thank You", "CART");
// A separate call to cmCreateShopAction9Tag should be made for each cart entry
cmCreateShopAction9Tag("12345", "Product X", "2","5000.42", "cust123", "order123",
"10011.79", "CATXYZ");
cmCreateShopAction9Tag("67890", "Product Y", "1", "10.95", "cust123", "order123",
"10011.79", "CATABC");
cmDisplayShops();
cmCreateOrderTag("order123", "10011.79", "5.95",
"cust123", "Austin", "TX", "78727");
cmCreateRegistrationTag("cust123", "registrant@mail.com", "Austin", "TX",
"78727", "US");
</script>
</body>
De-duplicate shop action 9 tag for Digital Analytics
Received Shop Action 9 tags are rejected from reporting if all tag parameters are identical to a previously received Shop Action 9 tag, including Order ID. If any Shop Action 9 tag parameter value changes, the new Shop Action 9 tag is accepted and reported again as new product purchase activity.
This is true even when the new Shop Action 9 tag Order ID parameter value exists within the contracted data retention period for this Digital Analytics Client ID (13 or 25 months).
De-duplicate shop action 9 tag for Explore and new Digital Analytics
Rejection of duplicate Shop Action 9 tags in Explore and the new Digital Analytics user interface is identical to previous versions of Digital Analytics, except that they compare new tags to only the last 48 hours of received tag data.
Registration tag attribute 50
Registration tag attribute 50 is reserved to syndicate an opt-in status for a registered visitor. Without this tag attribute, Campaign cannot accept visitor or event data for either the cart abandonment or cart purchase events.
By using information recorded in the Digital Analytics registration tag attributes, you can determine your visitors' opt-in or opt-out status for email communications. As a best practice, alias attribute 50 as contactConsent to reduce the odds of it being re-purposed.
Note: The -_-
delimiter cannot set apart individual opt-in or opt-out instructions. To send more than one opt-in or opt-out instruction, you must use multiple registration tags.
Attribute value | Value options (case insensitive) |
---|---|
Channel values | email, mobile, sms |
Instruction values | opt-in, opt-out, [null] |
Example registration attribute usage
Attribute slot: 50
Attribute alias: contactConsent
Attribute value: email, opt-in
Note: Registration tag attribute 50 is under the registration tag category and is different from the other shop action tags.
Configure other shop action tag attributes
In this integration, you can add the following attributes to both the Shop Action 5 and Shop Action 9 tags to augment the event data payload sent to Exchange and Campaign. By adding any of the listed Shop Action tag attributes, Exchange receives the corresponding event attribute when it receives an event from Digital Analytics.
- Shop action tag attributes: Exchange event attribute
- ShopAction tag attribute 50: productURL
- ShopAction tag attribute 49: imageURL
- ShopAction tag attribute 48: size
- ShopAction tag attribute 47: color
- ShopAction tag attribute 46: description
How tags work together
For the cart abandonment event, Digital Analytics first determines whether a browsing visitor has opted-in (registration attribute 50) to receive email marketing. If so, then Digital Analytics counts the number of products in the cart (shop action 5) when a visitor leaves the web page and ends the session without purchasing any products (shop action 9). The cart abandonment event triggers and is sent to Exchange and then consumed by Campaign.
Digital Analytics tagging requirements
Digital Analytics tags are required to register Digital Analytics events. The tag requirements depend on the events you want to subscribe to:
Cart abandonment
Tags required:
- Shop Action 5
- Shop Action 9
- Registration Tag Attribute 50
Cart purchase
Tags required:
- Shop Action 9
- Registration Tag Attribute 50