Track Page View Events - Bloomreach Experience - Open Source CMS

Track Page View Events

Global Page View Tracking

To get started, follow the steps given below:

1. Copy and paste the Global Page View Tracking Snippet & install on all of your pages 
2. Map the global variables in the tracking snippet.

Global Page View Tracking Snippet

<script type="text/javascript">
  var br_data = br_data || {};
  br_data.acct_id = "<Bloomreach Provided Account ID>"; 
  br_data.ptype = "<Bloomreach Page Type>";
  br_data.domain_key = "<Bloomreach Domain Key>";
  br_data.catalogs = "[ { "name" : "example_en_prd" } ]";
  br_data.view_id = "<Bloomreach View ID>";
  br_data.user_id = "<Bloomreach User ID>";
  br_data.tms = "<Tag Management system to exclude during transition>"
 
  (function() {
  var brtrk = document.createElement('script');
  brtrk.type = 'text/javascript';
  brtrk.async = true;
  brtrk.src = "//cdn.brcdn.com/v1/br-trk-{{BloomReach Account ID}}.js";
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(brtrk, s);
  })();
</script>

Global Page View Tracking Variables

Map these data variables in your Global Page View Code Snippet:

Account ID

Variable

Type

Example

Dependencies

Description

br_data.acct_id

 String

Variable Example: "1235"

Must be consistent with acct_id passed in API call.

 

The Bloomreach-provided Account identifier.

 

ptype

Variable

Type

Example

Dependencies

Description

br_data.ptype

String Variable Example: "homepage" Getting an accurate page type (ptype ) classification is a major component for all of Bloomreach's products. Maps your site's page type classifications to the values Bloomreach expects for our page type classifications. 

Required on all page views, including desktopmobile, and tablet versions. 

Bloomreach has 7 Page Type classifications.
See classification examples below.

Scenario

Example

Home Page Classification Any home page or landing page that is considered a home page needs to be classified as
br_data.ptype = "homepage"
Product Page Classification Any product, product bundle, product collection or sku set pages need to be classified as
br_data.ptype = "product"
Category Page Classification Any category listing pages, category product listing pages or pages that you consider a category page need to be classified as
br_data.ptype = "category"
Search Result Page Classification Any search listing or search results pages need to be classified as
br_data.ptype = "search"
Content Page Classification Any content pages need to be classified as 
br_data.ptype = "content"
Thematic Page Classification Bloomreach Thematic pages need to be classified as
br_data.ptype = "thematic"
Other Page Classification Any Conversion/ Thank You pages as well as any page types that are not one of the above need to be classified as
br_data.ptype = "other"

Domain Key (Required for multiple language versions)

Variable

Format

Example

Dependencies

Description

br_data.domain_key Variable Type: String
This field value is case-sensitive.

<accountName>_fr
Pass same Domain Key in the API call The Bloomreach-provided ID of the domain receiving the request. This parameter identifies the specific site language version when one account ID hosts multiple site versions with different languages. Bloomreach uses this value to ensure that only query and analytics data that pertain to that language are used for respective features.

Additional Information

This parameter is only required if you integrate on a site with multiple language versions. Otherwise, domain_key should not be declared in the pixel as this will cause issues with analytics.

The Bloomreach integrations team will inform you whether domain_key will be required for your pixel integration during the technical kickoff call.

View ID (Required for multiple site versions)

Variable

Type

Example

Dependencies

Description

br_data.view_id String
This field value is case-sensitive.
Variable Example: "10200" Consistent in Pixel, API & Feed. Identifies the specific site catalog view to show when one Bloomreach account ID hosts multiple site versions with unique product catalog characteristics, such as product price, availability, or title. 

Bloomreach uses View ID value to display the right product information for a user based on their site view. This must be consistent in the pixel, API and product catalog sent to Bloomreach.

Additional Information

This parameter is only required if you integrate on a site with multiple site versions with unique product catalog characteristics. Otherwise, view_id should not be declared in the pixel as this will cause issues with analytics.

The Bloomreach integrations team will inform you whether view_id will be required for your pixel integration during the technical kickoff call.

User ID (Required for tracking users with a universal customer ID)

Variable

Type

Example

Dependencies

Description

br_data.user_id  String Variable Example: "947345478564"   If you track users via a universal customer ID, populate this parameter with that ID. 
This should be an anonymized string (e.g. 947345478564). It should not contain the user's email or other personally identifiable information.

Additional Information

This parameter is only required if you track users via a universal customer ID .
This will allow Bloomreach to recognize users in a way that is aligned with your system for various personalization features.  

If you do not track users this way, leave this blank. 

Tms (Required if you are transitioning from one tag manager to another)

Variable

Type

Example

Dependencies

Description

br_data.tms  String " tlm "   The name of the Tag Management system, that should be filtered out. 

In case of migration from one tag management system to another, there may be a transition time frame, when the pixel is fired by two systems simultaneously. Setting the "tms" param will allow  Bloomreach analytics system  to filter out duplicate pixels. 

Bloomreach has the following Tag Mgmt classifications:
tms="tlm" for Tealium 
 

Additional Information

This parameter is optional and only required during the transition time from one tag management system to another. 
Leave this field empty, if this scenario does not apply.

Catalogs

Variable  Format Example Description
br_data.catalogs Array of Catalog objects "[ { "name" : "example_en_prd" } ]" List of catalogs that are shown in the page. In case the page has multiple tabs, only the catalogs of the selected (and visualized) tabs should be included. If multiple catalogs are shown in the active page (or tab) all of them should be included.

Test Data (for test environments only, do not declare on live site)

Variable Description
br_data.test_data="true" Flags pixel data to be ignored during analytics processing. This ensures that you can fire the pixel in a test environment, allowing you to perform pixel validation without affecting your analytics data.
 
Do not declare test_data in the pixel for your live site.

Multi-currency Variables

Multicurrency Pixel Guide

Variable

Type

Example

Dependencie

Description

br_data.currency String br_data.currency="GBP" N/A

Currency code for the transaction. Optional param. Default value is USD.

Supported currencies:    
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTC, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNH, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GGP, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IMP, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VES, VND, VUV, WST, XAF, XAG, XAU, XCD, XDR, XOF, XPD, XPF, XPT, YER, ZAR, ZMW, ZWL

Native App Implementation

To implement the Global View Pixels in the native app, you must include the following variables. For details on the native app implementation format, refer to the Non-JS Environment section in the Getting Started page. 

  • acct_id (see above)
  • ptype (see above)
  • domain_key (if needed, see above)
  • catalogs (see above)
  • view_id (if needed, see above)
  • user_id (if needed, see above)
  • test_data (if needed, see above)
  • cookie2
  • rand
  • title
  • url
  • ref
  • type
Name Variable Description Example
Anonymous Identifier cookie2

Anonymously identifies a particular device instance using a unique user ID (UUID). Format is uid={{UUID}}:v=app:ts=0:hc={{hitcount}}

For the UUID, we suggest the following:

  • iOS devices - use the IDFA
  • Android devices - use the Android Advertising ID
  • Other devices - use the closest equivalent

The hitcount value should be 1 for a new visitor, or 2 for returning visitors.

uid%3D1e7724c751a3f6e6241018d150144832e7528383%3Av%3Dapp%3Ats%3D0%3Ahc%3D1
Cache Buster rand A random number that is added to request to make sure browsers and proxies don't cache requests. 79069731271669680
Screen Name title Screen name of the app view. Blue%20Lace%20Dress
URL url

Synthetic unique URL composed of a static base URL and a screen app screen name.

Base URL: http://merchantname.app/

To help maintain uniqueness, prefix the screen name with the page type classification.

http://merchantname.app/{{ptype}}/{{title}}

ptype and title values here should match the values in their respective variables.

http%3A%2F%2Fmerchantname.app%2Fproduct%2Fblue%2520lace%2520dress
Referrer URL ref Synthetic URL from referrer screen. Follows same format as url param above. http%3A%2F%2Fmerchantname.app%2Fcategory%2Fdresses
Tracking Type type The type of tracking fire. For pageviews, type=pageview  

Example requests:

Global Page View

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?