Conversion tracking
If you have both One-to-many and One-to-one integrated on the same website, you only need to implement Bambuser Conversion Tracker once.
How to integrate Bambuser's tracking library for Conversion Tracking
This document covers how to add tracking of attributable purchases to improve the quality of your Bambuser Live Shopping statistics.
Introduction
Bambuser Conversion Tracking for Live Video Shopping gives you the most value out of your Live Shopping performance statistics. The Bambuser Conversion tracker enables merchants to attribute the relevant conversions to the LiveShopping shows. The number of attributed sales will be available on the stats page of each show.
For these purposes, Bambuser provides a small code snippet that needs to be added to the order confirmation page a.k.a. 'thank you' page.
How it works
Cookies
Bambuser Live Shopping player automatically sets the cookies below. These cookies are used by the Bambuser Conversion Tracker to find out whether a purchase is relevant to a LiveShopping show. If the below cookies exist and are valid, the purchase is considered as a conversion and is tracked to the show stats. If cookies are restricted, removed, or expired, Bambuser Conversion Tracker does not track the purchase.
Name | Expiration date | Product | Description |
---|---|---|---|
_bamls_cuid | 1 year |
| Unique identifier for the merchant. Used as a common denominator for all tracking performed by Bambuser to easily enable reporting and workspaces per merchant. |
_bamls_usid | 1 year |
| Unique identifier for a user. Used to attribute Bambuser statistics to a single site user. |
_bamls_seid | 30 min |
| Unique identifier for a session in which a Bambuser show or video was watched. Used in tracking to attribute statistics to a single session. |
_bamls_caid | 30 days |
| Unique identifier for the last Bambuser call that the user had on the merchant site. Used to attribute Bambuser statistics to a specific customer interaction. |
_bamls_shid | 30 days (Configurable) |
| Unique identifier for a Bambuser show. Used to attribute statistics to a single show. This also - similar to source/medium in Google Analytics - enables attribution of purchases (that do not occur within the embedded stream) towards the show. |
_bamls_lits | 30 days (Configurable) |
| The timestamp for the last known interaction in a Bambuser show. This is used in conjunction with _bamls_shid to measure at what point in time after a user viewed a show, the actual purchase was made. |
_bamls_lcte | 30 days (Configurable) |
| Structured data containing expiry timestamps for relevant server locations after which purchases will no longer be applicable for conversion tracking. |
The cookies are automatically set by Bambuser Live Video Shopping Player and Calls Widget.
Option 1: Direct integration
If you are using Google Tag Manager, see Bambuser LiveShopping GTM template.
The implementation is as simple as adding the below JavaScript code to your 'order confirmation' page. Additionally, you only need to populate the order information to the code.
- Global Servers
- EU Specific Servers
Tracking library URL is different depending on location of servers that your workspace is set up on. Use Global servers URL https://cdn.liveshopping.bambuser.com/metrics/bambuser.min.js
if the login to your Bambuser workspace is on following link: https://lcx.bambuser.com/.
<script>
// Your existing purchase handling function
function onPurchase() {
// Properties below should be named in this exact way!
// Replace the values
var data = {
event: "purchase", // value needs to be “purchase”
orderId: "12345", // the order id (String)
orderValue: "12345", // total of all products in the order (Number or String of numbers)
orderProductIds: "11,22,33,44,55", // comma-separated string, or array of all product ids in the order
currency: "USD", // the currency used for the order (ISO 4217)
};
// Send the data to Bambuser
window._bambuser.collect(data);
}
// Load the tracking library and sec invoke onPurchase() method
(function(){
var bamSrcElm = document.createElement('script');
bamSrcElm.src = 'https://cdn.liveshopping.bambuser.com/metrics/bambuser.min.js';
bamSrcElm.onload = onPurchase;
document.head.appendChild(bamSrcElm);
})();
</script>
Tracking library URL is different depending on location of servers that your workspace is set up on. Use European servers URL https://cdn.liveshopping.bambuser.com/metrics/bambuser-eu.min.js
if the login to your Bambuser workspace is on following link: https://lcx-eu.bambuser.com/.
<script>
// Your existing purchase handling function
function onPurchase() {
// Properties below should be named in this exact way!
// Replace the values
var data = {
event: "purchase", // value needs to be “purchase”
orderId: "12345", // the order id (String)
orderValue: "12345", // total of all products in the order (Number or String of numbers)
orderProductIds: "11,22,33,44,55", // comma-separated string, or array of all product ids in the order
currency: "USD", // the currency used for the order (ISO 4217)
};
// Send the data to Bambuser
window._bambuser.collect(data);
}
// Load the tracking library and sec invoke onPurchase() method
(function(){
var bamSrcElm = document.createElement('script');
bamSrcElm.src = 'https://cdn.liveshopping.bambuser.com/metrics/bambuser-eu.min.js';
bamSrcElm.onload = onPurchase;
document.head.appendChild(bamSrcElm);
})();
</script>
You can add the script above to your 'Purchase Confirmation' in different ways:
- Add it directly to your application code
- Inject it through a tag manager such as GTM, Tealium, and Adobe Analytics
Make sure you initialize the orderId
, orderValue
, orderProductIds
, currency
, and country
fields with valid data from the order.
Bambuser Conversion Tracker is a separate integration from the Bambuser LiveShopping Player integration. You will need to separately install the Conversion Tracker on your purchase confirmation page.
Option 2: Integration through GTM template
If you are using Google Tag Manager, you can implement Bambuser Conversion Tracker using a GTM template tag.
Requirements
- GTM container installed on the purchase confirmation page
- A Trigger for when an order is completed (purchase confirmation page)
- Variables to retrieve the order details below:
- Order ID
String
- Order value (total price of the order)
Number
- Order currency
String
- IDs of products in the order
String
/Array
- Order ID
Installing the Bambuser Live Shopping tag
Our tag is available on Google Tag Manager Community Template Gallery. To find it, you simply:
- Go to "Templates" in the left hand side menu
- Under "Tag Templates", press the Search Gallery button
- You should now see the "Import Tag Template" view. Either search for (search icon in the top right) "Bambuser Live Shopping" or simply scroll down until you find it and click on it.
You should now see the view below. Click "Add to workspace" and confirm the required permissions by pressing "Add" in the popup that appears. That's it!
We may update the tag. When we do, you will be notified in Google Tag Manager that an update is available.
Set up a tag
-
Create a new tag
On the Tags page, click onNew
to create a new tag. Choose "Bambuser Live Shopping" as the tag type (found under "Custom" when creating a new tag). -
Populating the tag
The tag requires four data points (likely from GTM variables) in order to send purchase data:- Order ID
- The ID of an order/transaction e.g.
'BM-GR-00123'
- The ID of an order/transaction e.g.
- Order Value
- Total value of the order, e.g.
1000
- Total value of the order, e.g.
- Currency
- The currency in which the Order Value was purchased
See a list of supported currency codes
E.g.'GBP'
,'USD'
, etc.
- The currency in which the Order Value was purchased
- Product IDs
- A comma-separated string or an array of product IDs that were part of the Order.
E.g.'123,456,789'
or['123', '456', '789']
- A comma-separated string or an array of product IDs that were part of the Order.
- Settings
- Enable debug mode
- When the tag is fired, it logs all the steps and errors in the browser console.
- Custom Tracking Library URL
- By default Tracking library is set to
https://cdn.liveshopping.bambuser.com/metrics/bambuser.min.js
. This is the URL used if your workspace is set up on Global Servers (Your login to Bambuser workspace is on https://lcx.bambuser.com/). In this case you do not need to populate this field.
https://cdn.liveshopping.bambuser.com/metrics/bambuser-eu.min.js
. - By default Tracking library is set to
- Enable debug mode
- Order ID
-
Set a trigger for the tag
Bambuser Conversion Tracker script should be run when a purchase is completed. Therefore, you need to have a trigger to fire the tag whenever a purchase is confirmed and the order data is available. -
Save the tag
Checkout on a subdomain
You will need an extra configuration if your checkout page is served under a subdomain of your main domain.
For example:
- The player is embedded on
https://example.com
orhttps://www.example.com
- But the checkout page is served under
https://checkout.example.com
By default, the cookies created by the player will not be accessible from the pages served under subdomains. You can make the cookies accessible on both the main domain and its subdomains (*.example.com
) by configuring domain
attribute for cookies in the player configuration. Set the domain name without the protocol (https://
part) and prefixing it by a dot (.example.com
).
Example:
window.onBambuserLiveShoppingReady = function(player) {
player.configure({
cookie: {
// Keep the dot prefix to allow cookies to be read from example.com and *.example.com
domain: '.example.com',
},
});
};
Verification
It is a good practice to verify the implementation by placing a test order.
Here are the steps:
- Watch a Bambuser LiveShopping show
- Add a few products to the cart
- Open the browser DevTools (inspect), head to the Network tab, and leave it open
- Complete the checkout and proceed to the order confirmation page
- Check the Network tab in the DevTools and filter by 'metric'
- Find the request to Bambuser
/metric
endpoint that includes the purchase data in the request payload, as below: - Make sure all the sent data is correct and has the expected data types according to the requirements.
- If you are unable to verify the order being tracked, head over to the troubleshooting checklist.
Troubleshoot
Conversion tracking FAQ
For backward compatibility reasons, cookies are not created unless the onBambuserLiveShoppingReady()
function is defined. By adding the below code to your LiveShopping landing page, you should be able to see the cookies are set.
if (typeof window.onBambuserLiveShoppingReady === 'undefined') {
window.onBambuserLiveShoppingReady = function() {};
}
If a user has disabled/remove cookies, the conversion tracking will not work for that particular user. However, the user experience on the player will be the same.
No. When a customer watches a live show on the One-to-many player or join a call from the One-to-one Calls Widget, the Bambuser cookies are set on the user browser session.
All purchases from the same user will be tracked in a 30-day window after the last user interaction.
orderID
is currently used for identifying "duplicate rows" as we may recieve duplicate purchase data.orderProductId
will be used for future features.