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.

PropertyExample ValueDescription
user_id15e7a61137553b-09451a8fc6d1d2-e313761-100200-15e7a611379e2bThe unique ID that identifies the user.
page_urlhttp://go.lightsaber.com/free-demoThe page URL of the viewed page
referring_urlhttp://go.lightsaber.com/The previous page that linked to the current page
page_titleThank You for Downloading Behavioral AnalyticsThe page title
session_duaMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36The directory user agent. Refers to a web browser telling a website information about the browser and operating system.
session_platformWin32The platform the user is operating from (Windows, iOS, Android etc.)
event_namepage_loadThe name of the event
session_ip174.19.217.119The ip from which the call originated
referring_domaingo.lightsaber.comThe 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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
item_nameLight saberThe name of the product in the catalog
item_id22529378The unique ID of the product in the catalog
item_categoryToysThe category the product belongs to
item_quantity2The quantity of products (of same type) that were added to the cart
item_discount49.5The discount the product received
item_discount_typeBuy one get oneThe type of discount that was applied to this product
total_discount49.5The total discount for the current purchase
item_catalog_price99Product price before product customization or discount
item_price49.5Actual product price in catalog
currencyUSDThe currency in which the product was purchased in
number_of_items5The number of purchased item for the current purchase
order_total189The 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.

PropertyExample ValueDescription
search_results[green light-saber, purple light-saber, red light-saber]The search results the query returned
search_results_count10The number of search results the query returned
search_term"villains' light sword"The search term used by the user for the search
current_page_number2The number of results page (INT, 1 if NULL)
items_per_page20How 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:

log_in event

Use to capture the customer's log-in data.

PropertyValue TypeDescription
user_alternative_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user on the platform.
user_emailjake.land@jakeland.ioThe email used by the user to log into the system
login_successtrueWas the log-in successful?
login_errorEmail address invalid, please try againAny 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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
item_nameLight saberThe name of the product in the catalog
item_id22529378The unique ID of the product in the catalog
item_categoryToysThe category the product belongs to
item_quantity2The quantity of products (of same type) that were added to the cart
item_discount49.5The discount the product received
item_discount_typeBuy one get oneThe type of discount that was applied to this product
item_catalog_price99Product price before product customization or discount
item_price49.5Actual product price in catalog
currencyUSDThe currency in which the product was purchased in
item_genderUnisexThe gender the product is meant for (clothing & jewelry specific)
item_colorSilverThe color/colors of the product
item_stylecrossguardAny styles related to the product
item_descriptionThe perfect villain gift: the crossguard lightsaberPartial/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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
item_nameLight saberThe name of the product in the catalog
item_id22529378The unique ID of the product in the catalog
item_categoryToysThe category the product belongs to
item_quantity2The quantity of products (of same type) that were added to the cart
item_discount49.5The discount the product received
item_discount_typeBuy one get oneThe type of discount that was applied to this product
item_catalog_price99Product price before product customization or discount
item_price49.5Actual product price in catalog
currencyUSDThe currency in which the product was purchased in
item_genderUnisexThe gender the product is meant for (clothing & jewelry specific)
item_colorSilverThe color/colors of the product
item_styleCrossguardAny styles related to the product
item_descriptionThe perfect villain gift: the crossguard lightsaberPartial/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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
item_nameLight saberThe name of the product in the catalog
item_id22529378The unique ID of the product in the catalog
item_categoryToysThe category the product belongs to
item_quantity2The quantity of products (of same type) that were added to the cart
item_discount49.5The discount the product received
item_discount_typeBuy one get oneThe type of discount that was applied to this product
item_catalog_price99Product price before product customization or discount
item_price49.5Actual product price in catalog
currencyUSDThe currency in which the product was purchased in
item_genderUnisexThe gender the product is meant for (clothing & jewelry specific)
item_colorSilverThe color/colors of the product
item_styleCrossguardAny styles related to the product
item_descriptionThe perfect villain gift: the crossguard lightsaberPartial/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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
item_nameLight saberThe name of the product in the catalog
item_id22529378The unique ID of the product in the catalog
item_categoryToysThe category the product belongs to
item_quantity2The quantity of products (of same type) that were added to the cart
item_discount49.5The discount the product received
item_discount_typeBuy one get oneThe type of discount that was applied to this product
item_catalog_price99Before product customization or discount
item_price49.5Actual product price in catalog
currencyUSDThe currency in which the product was purchased in
order_total189The 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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
shipping_first_nameJakeThe first name of the recipient
shipping_last_nameLandThe last name of the recipient
shipping_street_nameMain St.The street name of the recipient
shipping_house_number35The house number of the recipient
shipping_postal_code94101The postal code of the recipient
shipping_citySan FranciscoThe city of the recipient
shipping_countryUSAThe country of the recipient
shipping_stateCAThe state of the recipient (if applicable)
shipping_phone_number(415) 765-77241The phone number of the recipient
shipping_methodUSPS Express MailPreferred shipping method by recipient
shipping_user_emailjake.land@jakeland.ioRecipient's email address
shipping_notification_optintrueDid the recipient opted-in for shipment/news notifications?
shipping_error_messageStreet name is missingWhat 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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
user_emailjake.land@jakeland.ioThe user's email address for sending the newsletter
email_errorPlease enter a valid email addressErrors 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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
item_nameLight saberThe name of the product in the catalog
item_id22529378The unique ID of the product in the catalog
item_categoryToysThe category the product belongs to
items_per_page10How many items are shown per single catalog page
item_page_position3Item position on the page
catalog_page_number1The 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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
item_nameLight saberThe name of the product in the catalog
item_id22529378The unique ID of the product in the catalog
item_categoryToysThe category the product belongs to
items_per_page10How many items are shown per single catalog page
item_discount50The discount the product received
item_discount_typeBuy one get oneThe type of discount that was applied to this product
currencyUSDThe currency in which the product was purchased in
item_page_position3Item position on the page
catalog_page_number1The 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.

PropertyExample ValueDescription
user_id6c84fb90-12c4-11e1-840d-7b25c5ee775aThe unique ID that identifies the user.
social_network_nameTwitterThe name of the social network
social_network_urlhttps://twitter.com/villainit?lang=enThe 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.

PropertyExample ValueDescription
coupon_id#7YA453The promo code ID redeemed by the user.
coupon_nameBlack Friday blitz!The name of the coupon.
coupon_descriptionUse this $100 rebate coupon on any electronics products in our store!The text description of the coupon.
reward_amount100The amount of the reward given in exchange for redeeming the promo code.
reward_currencyUSDThe currency of the reward given in exchange for redeeming the promo code.
creation_datetime2019-12-30 23:59:59The coupon creation datetime.
expiration_datetime9999-12-31 23:59:59The coupon expiration datetime.
redeeming_datetime2019-12-31 22:59:59The coupon redemption datetime.
notificationRedeeming coupon failed! This coupon was already used.Any system notification to the user during the process of redeeming the coupon.
statusfailThe 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'});