Analytics Script
Out of the box analytics platform supporting API clients.
Last updated
Out of the box analytics platform supporting API clients.
Last updated
If you use the Smart Size Chart, this functionality already exists in that application, and you do not need to add this to your site!
Bold Metrics will identify several elements on your site and listen for events on those elements. Those include:
Users opening your size chart
Users opening your Fit Tool (your application that calls the Bold Metrics API)
Users that Add to Cart
In addition, Analytics offers the ability to collect the API response. When you call the Bold Metrics API, you can trigger a DOM event with the API response as the payload to send the response to Analytics. .
There are three steps to add Analytics to your site:
This is the first step to integrating Analytics onto your site. This script tag must be included in the <head> element of your PDP:
Add the following element anywhere on the page. This element will not show to the user, so any location on your PDP will work.
Analytics will only load if this element is found. If this element is not found, Analytics will not load.
In order for Bold Metrics to join your purchase data with the recommendation data, you’ll need to call the API with the user id that is generated by Analytics.
Once you’ve successfully called the API, you can send the API response to Analytics. Here is sample code to call the DOM event. Analytics has a listener for this DOM event:
The user id can be found in cookies under the name bm
. There you’ll find a UUID
hash that needs to populate the anon_id
when you call the Bold Metrics API. This user id is generated after Analytics loads.