Ecommerce events
These events and their properties are specially designed to track the actions ecommerce customers take during their shopping journey. Tracking them will cover most of the events you will need to use for your industry.
page_load
Use to collect basic data during page load.
Property | Example Value | Description |
---|---|---|
user_id | 15e7a61137553b-09451a8fc6d1d2-e313761-100200-15e7a611379e2b | The unique ID that identifies the user. |
page_url | http://go.lightsaber.com/free-demo | The page URL of the viewed page |
referring_url | http://go.lightsaber.com/ | The previous page that linked to the current page |
page_title | Thank You for Downloading Behavioral Analytics | The page title |
session_dua | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 | The directory user agent. Refers to a web browser telling a website information about the browser and operating system. |
session_platform | Win32 | The platform the user is operating from (Windows, iOS, Android etc.) |
event_name | page_load | The name of the event |
session_ip | 174.19.217.119 | The ip from which the call originated |
referring_domain | go.lightsaber.com | The domain that referred to the current page |
For more information see the Cooladata JS tracker.
Relevant reports:
page_load_enrich
Use to enrich the page_load data in the cart, checkout and thank you pages.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
item_name | Light saber | The name of the product in the catalog |
item_id | 22529378 | The unique ID of the product in the catalog |
item_category | Toys | The category the product belongs to |
item_quantity | 2 | The quantity of products (of same type) that were added to the cart |
item_discount | 49.5 | The discount the product received |
item_discount_type | Buy one get one | The type of discount that was applied to this product |
total_discount | 49.5 | The total discount for the current purchase |
item_catalog_price | 99 | Product price before product customization or discount |
item_price | 49.5 | Actual product price in catalog |
currency | USD | The currency in which the product was purchased in |
number_of_items | 5 | The number of purchased item for the current purchase |
order_total | 189 | The total order amount for the current purchase |
Event tracking code:
//get the user id from the cookie
function getUserIdFromCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
//get the relevant event properties from the DOM elements
var userAlternativeId = getUserIdFromCookie('user_alternative_id');
var itemName = document.getElementById('item_name').innerHTML;
var itemId = document.getElementById('item_id').innerHTML;
var itemCategory = document.getElementById('item_category').innerHTML;
var itemQuantity = document.getElementById('item_quantity').innerHTML;
var itemDiscount = document.getElementById('item_discount').innerHTML;
var itemDiscountType = document.getElementById('item_discount_type').innerHTML;
var totalDiscount = document.getElementById('total_discount').innerHTML;
var itemPrice = document.getElementById('item_price').innerHTML;
var itemCatalogPrice = document.getElementById('item_catalog_price').innerHTML;
var currency = document.getElementById('currency').innerHTML;
var numberOfItems = document.getElementById('number_of_items').innerHTML;
var orderTotal = document.getElementById('order_total').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('page_load_enrich', {'user_alternative_id':userAlternativeId ,'item_name': itemName, 'item_id':itemId, 'item_category':itemCategory, 'item_quantity':itemQuantity, 'item_discount':itemDiscount, 'item_discount_type':itemDiscountType, 'total_discount':totalDiscount, 'item_price':itemPrice, 'item_catalog_price':itemCatalogPrice,'currency':currency, 'number_of_items':numberOfItems, 'order_total':orderTotal});
Relevant reports:
user_search
Use to capture a search action by the user.
Property | Example Value | Description |
---|---|---|
search_results | [green light-saber, purple light-saber, red light-saber] | The search results the query returned |
search_results_count | 10 | The number of search results the query returned |
search_term | "villains' light sword" | The search term used by the user for the search |
current_page_number | 2 | The number of results page (INT, 1 if NULL) |
items_per_page | 20 | How many items per page were presented to the user (INT, 0 if NULL) |
Event tracking code:
//get the relevant event properties from the DOM elements
var searchResults = document.getElementById('search_results').innerHTML;
var searchTerm = document.getElementById('search_term').innerHTML;
var currentPageNumber = document.getElementById('current_page_number').innerHTML;
var itemsPerPage = document.getElementById('items_per_page').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('user_search', {'search_results':searchResults, 'search_term':searchTerm , 'current_page_number':currentPageNumber, 'items_per_page':itemsPerPage});
Relevant reports:
- User search term distribution
- Search action leads to shopping cart
- Search action leads to purchase
- Unavailable search term results
- Search action with low results count
- Average/median number of results per search
- Average/median unique search actions per session without conversion
- Average/median number of search actions per user
- Number of products viewed
log_in event
Use to capture the customer's log-in data.
Property | Value Type | Description |
---|---|---|
user_alternative_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user on the platform. |
user_email | jake.land@jakeland.io | The email used by the user to log into the system |
login_success | true | Was the log-in successful? |
login_error | Email address invalid, please try again | Any error that is presented to the user during the log-in process |
Event tracking code:
//get the relevant event properties from the DOM elements
var userAlternativeId = document.getElementById('user_alternative_id').innerHTML;
var userEmail = document.getElementById('user_email').innerHTML;
var loginSuccess = document.getElementById('login_success').innerHTML;
var loginError = document.getElementById('login_error').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('log_in', {'user_alternative_id': userAlternativeId, 'user_email': userEmail, 'login_success':loginSuccess, 'login_error':loginError});
Relevant reports:
add_to_cart event
Use to capture data when the customer adds a product to the cart.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
item_name | Light saber | The name of the product in the catalog |
item_id | 22529378 | The unique ID of the product in the catalog |
item_category | Toys | The category the product belongs to |
item_quantity | 2 | The quantity of products (of same type) that were added to the cart |
item_discount | 49.5 | The discount the product received |
item_discount_type | Buy one get one | The type of discount that was applied to this product |
item_catalog_price | 99 | Product price before product customization or discount |
item_price | 49.5 | Actual product price in catalog |
currency | USD | The currency in which the product was purchased in |
item_gender | Unisex | The gender the product is meant for (clothing & jewelry specific) |
item_color | Silver | The color/colors of the product |
item_style | crossguard | Any styles related to the product |
item_description | The perfect villain gift: the crossguard lightsaber | Partial/full description of the product |
Event tracking code:
//get the relevant event properties from the DOM elements
var itemName = document.getElementById('item_name').innerHTML;
var itemId = document.getElementById('item_id').innerHTML;
var itemCategory = document.getElementById('item_category').innerHTML;
var itemQuantity = document.getElementById('item_quantity').innerHTML;
var itemDiscount = document.getElementById('item_discount').innerHTML;
var itemDiscountType = document.getElementById('item_discountType').innerHTML;
var itemPrice = document.getElementById('item_price').innerHTML;
var currency = document.getElementById('currency').innerHTML;
var itemCatalogPrice = document.getElementById('item_catalog_price').innerHTML;
var itemSize = document.getElementById('item_size').innerHTML;
var itemGender = document.getElementById('item_gender').innerHTML;
var itemColor = document.getElementById('item_color').innerHTML;
var itemStyle = document.getElementById('item_style').innerHTML;
var itemDescription = document.getElementById('item_description').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('add_to_cart', {'item_name': itemName, 'item_id':itemId, 'item_category':itemCategory,'item_quantity':itemQuantity, 'item_discount':itemDiscount, 'item_discount_type':itemDiscountType, 'item_price':itemPrice, 'currency':currency,'item_catalog_price':itemCatalogPrice,'item_size':itemSize,'item_gender':itemGender,item_color':itemColor,'item_style':itemStyle,'item_description':itemDescription});
Relevant reports:
add_to_wish_list event
Use to capture data when the customer adds a product to the wish list.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
item_name | Light saber | The name of the product in the catalog |
item_id | 22529378 | The unique ID of the product in the catalog |
item_category | Toys | The category the product belongs to |
item_quantity | 2 | The quantity of products (of same type) that were added to the cart |
item_discount | 49.5 | The discount the product received |
item_discount_type | Buy one get one | The type of discount that was applied to this product |
item_catalog_price | 99 | Product price before product customization or discount |
item_price | 49.5 | Actual product price in catalog |
currency | USD | The currency in which the product was purchased in |
item_gender | Unisex | The gender the product is meant for (clothing & jewelry specific) |
item_color | Silver | The color/colors of the product |
item_style | Crossguard | Any styles related to the product |
item_description | The perfect villain gift: the crossguard lightsaber | Partial/full description of the product |
Event tracking code:
//get the relevant event properties from the DOM elements
var itemName = document.getElementById('item_name').innerHTML;
var itemId = document.getElementById('item_id').innerHTML;
var itemCategory = document.getElementById('item_category').innerHTML;
var itemQuantity = document.getElementById('item_quantity').innerHTML;
var itemDiscount = document.getElementById('item_discount').innerHTML;
var itemPrice = document.getElementById('item_price').innerHTML;
var currency = document.getElementById('currency').innerHTML;
var itemCatalogPrice = document.getElementById('item_catalog_price').innerHTML;
var discountType = document.getElementById('discount_type').innerHTML;
var itemSize = document.getElementById('item_size').innerHTML;
var itemGender = document.getElementById('item_gender').innerHTML;
var itemStyle = document.getElementById('item_style').innerHTML;
var itemDescription = document.getElementById('item_description').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('add_to_wish_list', {'item_name': itemName, 'item_id':itemId, 'item_category':itemCategory, 'item_quantity':itemQuantity, 'item_discount':itemDiscount, 'item_price':itemPrice, 'currency':currency,'item_catalog_price':itemCatalogPrice,'discount_type':discountType,'item_size':itemSize,'item_gender':itemGender, 'item_color':itemColor,'item_style':itemStyle,'item_description':itemDescription});
Relevant reports:
remove_from_wish_list event
Use to capture data when the customer removes a product from the wish list.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
item_name | Light saber | The name of the product in the catalog |
item_id | 22529378 | The unique ID of the product in the catalog |
item_category | Toys | The category the product belongs to |
item_quantity | 2 | The quantity of products (of same type) that were added to the cart |
item_discount | 49.5 | The discount the product received |
item_discount_type | Buy one get one | The type of discount that was applied to this product |
item_catalog_price | 99 | Product price before product customization or discount |
item_price | 49.5 | Actual product price in catalog |
currency | USD | The currency in which the product was purchased in |
item_gender | Unisex | The gender the product is meant for (clothing & jewelry specific) |
item_color | Silver | The color/colors of the product |
item_style | Crossguard | Any styles related to the product |
item_description | The perfect villain gift: the crossguard lightsaber | Partial/full description of the product |
Event tracking code:
//get the relevant event properties from the DOM elements
var itemName = document.getElementById('item_name').innerHTML;
var itemId = document.getElementById('item_id').innerHTML;
var itemCategory = document.getElementById('item_category').innerHTML;
var itemQuantity = document.getElementById('item_quantity').innerHTML;
var itemDiscount = document.getElementById('item_discount').innerHTML;
var itemPrice = document.getElementById('item_price').innerHTML;
var currency = document.getElementById('currency').innerHTML;
var itemCatalogPrice = document.getElementById('item_catalog_price').innerHTML;
var discountType = document.getElementById('discount_type').innerHTML;
var itemSize = document.getElementById('item_size').innerHTML;
var itemGender = document.getElementById('item_gender').innerHTML;
var itemStyle = document.getElementById('item_style').innerHTML;
var itemDescription = document.getElementById('item_description').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('remove_from_wish_list', {'item_name': itemName, 'item_id':itemId, 'item_category':itemCategory, 'item_quantity':itemQuantity, 'item_discount':itemDiscount, 'item_price':itemPrice, 'currency':currency,'item_catalog_price':itemCatalogPrice,'discount_type':discountType,'item_size':itemSize,'item_gender':itemGender, 'item_color':itemColor,'item_style':itemStyle,'item_description':itemDescription});
Relevant reports:
cart_remove_item event
Use to capture data when the customer removes a product from the cart.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
item_name | Light saber | The name of the product in the catalog |
item_id | 22529378 | The unique ID of the product in the catalog |
item_category | Toys | The category the product belongs to |
item_quantity | 2 | The quantity of products (of same type) that were added to the cart |
item_discount | 49.5 | The discount the product received |
item_discount_type | Buy one get one | The type of discount that was applied to this product |
item_catalog_price | 99 | Before product customization or discount |
item_price | 49.5 | Actual product price in catalog |
currency | USD | The currency in which the product was purchased in |
order_total | 189 | The total order amount for the current purchase |
Event tracking code:
//get the relevant event properties from the DOM elements
var itemName = document.getElementById('item_name').innerHTML;
var itemId = document.getElementById('item_id').innerHTML;
var itemCategory = document.getElementById('item_category').innerHTML;
var itemQuantity = document.getElementById('item_quantity').innerHTML;
var itemDiscount = document.getElementById('item_discount').innerHTML;
var itemDiscountType = document.getElementById('item_discount_type').innerHTML;
var itemPrice = document.getElementById('item_price').innerHTML;
var itemCatalogPrice = document.getElementById('item_catalog_price').innerHTML;
var currency = document.getElementById('currency').innerHTML;
var orderTotal = document.getElementById('order_total').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('cart_remove_item', {'item_name': itemName, 'item_id':itemId, 'item_category':itemCategory, 'item_quantity':itemQuantity, 'item_discount':itemDiscount, 'item_discount_type':itemDiscountType, 'item_price':itemPrice, 'item_catalog_price':itemCatalogPrice,'currency':currency,'order_total':orderTotal});
Relevant reports:
checkout_form event
Use to capture data when the customer is submitting the checkout form.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
shipping_first_name | Jake | The first name of the recipient |
shipping_last_name | Land | The last name of the recipient |
shipping_street_name | Main St. | The street name of the recipient |
shipping_house_number | 35 | The house number of the recipient |
shipping_postal_code | 94101 | The postal code of the recipient |
shipping_city | San Francisco | The city of the recipient |
shipping_country | USA | The country of the recipient |
shipping_state | CA | The state of the recipient (if applicable) |
shipping_phone_number | (415) 765-77241 | The phone number of the recipient |
shipping_method | USPS Express Mail | Preferred shipping method by recipient |
shipping_user_email | jake.land@jakeland.io | Recipient's email address |
shipping_notification_optin | true | Did the recipient opted-in for shipment/news notifications? |
shipping_error_message | Street name is missing | What error messages were triggered during filling in the checkout form |
Event tracking code:
//get the relevant event properties from the DOM elements
var firstName = document.getElementById('first_name').innerHTML;
var lastName = document.getElementById('last_name').innerHTML;
var streetName = document.getElementById('street_name').innerHTML;
var houseNumber = document.getElementById('house_number').innerHTML;
var postalCode = document.getElementById('postal_code').innerHTML;
var city = document.getElementById('city').innerHTML;
var state = document.getElementById('state').innerHTML;
var country = document.getElementById('country').innerHTML;
var phoneNumber = document.getElementById('phone_number').innerHTML;
var shippingMethod = document.getElementById('shipping_method').innerHTML;
var userEmail = document.getElementById('user_email').innerHTML;
var notificationOptIn = document.getElementById('notification_opt_in').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('checkout_form', {'first_name': firstName, 'last_name':lastName, 'street_name':streetName, 'house_number':houseNumber, 'postal_code':postalCode, 'city':city,'state':state,'country':country,'phone_number':phoneNumber,'shipping_method':shippingMethod,'user_email':userEmail,'notification_opt_in':notificationOptIn});
newsletter event
Use to capture data when the customer is submitting the newsletter request.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
user_email | jake.land@jakeland.io | The user's email address for sending the newsletter |
email_error | Please enter a valid email address | Errors while filling the newsletter form |
Event tracking code:
//get the relevant event properties from the DOM elements
var userEmail = document.getElementById('user_email').innerHTML;
var emailError = document.getElementById('email_error').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('newsletter', {'user_email':userEmail, 'email_error':emailError});
impression event
Use to capture data when a product is seen by the customer.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
item_name | Light saber | The name of the product in the catalog |
item_id | 22529378 | The unique ID of the product in the catalog |
item_category | Toys | The category the product belongs to |
items_per_page | 10 | How many items are shown per single catalog page |
item_page_position | 3 | Item position on the page |
catalog_page_number | 1 | The number of page in the catalog the product was shown on |
Event tracking code:
//get the relevant event properties from the DOM elements
var itemName = document.getElementById('item_name').innerHTML;
var itemId = document.getElementById('item_id').innerHTML;
var itemCategory = document.getElementById('item_category').innerHTML;
var itemsPerPage = document.getElementById('items_per_page').innerHTML;
var itemPagePosition = document.getElementById('item_page_position').innerHTML;
var catalogPageNumber = document.getElementById('catalog_page_number').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('impression', {'item_name': itemName, 'item_id':itemId, 'item_category':itemCategory, 'items_per_page':itemsPerPage, 'item_page_position':itemPagePosition, 'catalog_page_number':catalogPageNumber});
click_item event
Use to capture data when a customer clicks a product.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
item_name | Light saber | The name of the product in the catalog |
item_id | 22529378 | The unique ID of the product in the catalog |
item_category | Toys | The category the product belongs to |
items_per_page | 10 | How many items are shown per single catalog page |
item_discount | 50 | The discount the product received |
item_discount_type | Buy one get one | The type of discount that was applied to this product |
currency | USD | The currency in which the product was purchased in |
item_page_position | 3 | Item position on the page |
catalog_page_number | 1 | The number of page in the catalog the product was shown on |
Event tracking code:
//get the relevant event properties from the DOM elements
var itemName = document.getElementById('item_name').innerHTML;
var itemId = document.getElementById('item_id').innerHTML;
var itemCategory = document.getElementById('item_category').innerHTML;
var itemsPerPage = document.getElementById('items_per_page').innerHTML;
var itemDiscount = document.getElementById('item_discount').innerHTML;
var itemDiscountType = document.getElementById('item_discount_type').innerHTML;
var currency = document.getElementById('currency').innerHTML;
var itemPagePosition = document.getElementById('item_page_position').innerHTML;
var catalogPageNumber = document.getElementById('catalog_page_number').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('click_item', {'item_name': itemName, 'item_id':itemId, 'item_category':itemCategory, 'items_per_page':itemsPerPage, 'item_discount':itemDiscount, 'item_discount_type':itemDiscountType, 'currency':currency, 'item_page_position':itemPagePosition, 'catalog_page_number':catalogPageNumber});
Relevant reports:
click_social event
Use to capture data when a customer clicks a social link.
Property | Example Value | Description |
---|---|---|
user_id | 6c84fb90-12c4-11e1-840d-7b25c5ee775a | The unique ID that identifies the user. |
social_network_name | The name of the social network | |
social_network_url | https://twitter.com/villainit?lang=en | The URL of the social network |
Event tracking code:
//get the relevant event properties from the DOM elements
var socialNetworkName = document.getElementById('social_network_name').innerHTML;
var socialNetworkUrl = document.getElementById('social_network_url').innerHTML;
//send event with collected property elements to Cooladata
cooladata.trackEvent('click_social', {'social_network_name': socialNetworkName, 'social_network_url':socialNetworkUrl});
redeem_coupon event
Use this event when the user redeems a coupon.
Property | Example Value | Description |
---|---|---|
coupon_id | #7YA453 | The promo code ID redeemed by the user. |
coupon_name | Black Friday blitz! | The name of the coupon. |
coupon_description | Use this $100 rebate coupon on any electronics products in our store! | The text description of the coupon. |
reward_amount | 100 | The amount of the reward given in exchange for redeeming the promo code. |
reward_currency | USD | The currency of the reward given in exchange for redeeming the promo code. |
creation_datetime | 2019-12-30 23:59:59 | The coupon creation datetime. |
expiration_datetime | 9999-12-31 23:59:59 | The coupon expiration datetime. |
redeeming_datetime | 2019-12-31 22:59:59 | The coupon redemption datetime. |
notification | Redeeming coupon failed! This coupon was already used. | Any system notification to the user during the process of redeeming the coupon. |
status | fail | The status of trying to redeem the coupon: fail, success. |
Event tracking code:
//get the relevant event properties from the DOM elements
var couponId = document.getElementById('coupon_id').innerHTML;
var couponName = document.getElementById('coupon_name').innerHTML;
var couponDescription = document.getElementById('coupon_description').innerHTML;
var rewardAmount = document.getElementById('reward_amount').innerHTML;
var rewardCurrency = document.getElementById('reward_currency').innerHTML;
var creationDatetime = document.getElementById('creation_datetime').innerHTML;
var expirationDatetime = document.getElementById('expiration_datetime').innerHTML;
var redeemingDatetime = document.getElementById('redeeming_datetime').innerHTML;
var notification = document.getElementById('notification').innerHTML;
var status = document.getElementById('status').innerHTML;
//send event with the collected property elements to Cooladata
cooladata.trackEvent('redeem_coupon', {'coupon_id':couponId, 'coupon_name':couponName, 'coupon_description':couponDescription, 'reward_amount':rewardAmount, 'reward_currency':rewardCurrency, 'creation_datetime':creationDatetime, 'expiration_datetime':expirationDatetime,
'redeeming_datetime':redeemingDatetime, 'notification':notification, 'status:status'});