Content Search Pixel Integration Scenarios - Bloomreach Experience - Open Source CMS

Content Search Pixel Integration Scenarios

This page describes different scenarios in which to use the Bloomreach pixels for proper Content Search integration. These scenarios take into account the following factors:

  • Site Type: Whether the site you wish to power search with is Single or Multi-Site.
  • Customer: If you are a New customer for Content Search or an existing product search customers looking to add content search. 
  • Search Solution: If you are using Bloomreach solution to power Product Search only or Product as well as Content Search.

For merchants with multiple domains and site versions, it also takes into account:

  • Views: Views show selective content to selective users, such as content-based on regions or stores. This can be Single or Multiple.
  • Domain Keys: A merchant can have Single or Multiple domains and subdomains for sub-brands or multiple languages.

The examples given below are for Search Page View pixel integration in different scenarios: 

Merchants with Single Site Version

Merchants that only display a single version of their site to all customers.

Site Versions: Single

Solution: Product Only

Pixel Sample: Search Page View Tracking Pixel

< script type = "text/javascript" >
   var br_data = br_data || {};

   br_data.acct_id = "1234";
   br_data.ptype = "search";
   br_data.search_term = "omelette";
   br_data.domain_key = "<default domain key>"; # standard value that remains unchanged for a customer without multiple domains or multiple versions of their site 
   br_data.catalogs = [ { "name": "<catalog name for the default domain key>" }]; # name of the product catalog. Note: this isn't useful if a customer only has a single product catalog. But, for consistency and future-proofing we require everyone send it. BR Technical Consultant will provide this.

   (function () {
    var brtrk = document.createElement('script');
    brtrk.type = 'text/javascript';
    brtrk.async = true;
    brtrk.src = 'https:' == document.location.protocol ? "https://cdns.brsrvr.com/v1/br-trk-{{BloomReach Account ID}}.js" : "http://cdn.brcdn.com/v1/br-trk-{{BloomReach Account ID}}.js";
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(brtrk, s);
    })(); 
</script> 
<script type="text/javascript" >

Site Versions: Single

Solution: Product and Content

Scenario 1: When results are in a tabbed format and user is on the product catalog search page

< script type = "text/javascript" >
    var br_data = br_data || {};
    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>";  # standard value that remains unchanged for a customer without multiple domains or multiple versions of their site 
    br_data.catalogs = [ { "name": "<product_catalog_name>" } ]; # name of the product catalog being viewed in the tab

    (function (){
    var brtrk = document.createElement('script');
    brtrk.type = 'text/javascript';
    brtrk.async = true;
    brtrk.src = 'https:' == document.location.protocol ? "https://cdns.brsrvr.com/v1/br-trk-{{BloomReach Account ID}}.js" : "http://cdn.brcdn.com/v1/br-trk-{{BloomReach Account ID}}.js";
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(brtrk, s);
    })(); 
< /script> 
<script type="text/javascript" >

Scenario 2: When results are in a tabbed format and user is on the content catalog search page

< script type = "text/javascript" >
    var br_data = br_data || {};

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged for a customer without multiple domains or multiple versions of their site
    br_data.catalogs = [ { "name": "<content_catalog_name>" } ]; # name of the content catalog being viewed in the tab

   (function (){
    var brtrk = document.createElement('script');
    brtrk.type = 'text/javascript';
    brtrk.async = true;
    brtrk.src = 'https:' == document.location.protocol ? "https://cdns.brsrvr.com/v1/br-trk-{{BloomReach Account ID}}.js" : "http://cdn.brcdn.com/v1/br-trk-{{BloomReach Account ID}}.js";
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(brtrk, s);
})(); 
</script> 
<script type = "text/javascript">

Scenario 3: When results for product and content are on the same page

< script type = "text/javascript" >
    var br_data = br_data || {};

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged for a customer without multiple domains or multiple versions of their site
    br_data.catalogs = [{ "name": "<product_catalog_name>" },{ "name": "<content_catalog_name>" }]; # includes the names of all the catalogs being viewed on that page

   (function (){
    var brtrk = document.createElement('script');
    brtrk.type = 'text/javascript';
    brtrk.async = true;
    brtrk.src = 'https:' == document.location.protocol ? "https://cdns.brsrvr.com/v1/br-trk-{{BloomReach Account ID}}.js" : "http://cdn.brcdn.com/v1/br-trk-{{BloomReach Account ID}}.js";
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(brtrk, s);
})(); 
</script> 
< script type = "text/javascript" >

Merchants with multiple domains and versions of their site

Merchants that have either multiple domains or different versions of their site. For example, a site that has a version for English and another version for French.

Site Versions: Multiple

Solution: Product Only

Views: Single

Domain Keys: Multiple

Scenario 1: When analytics need to distinguish between the two sites (e.g. when moving from an English site to a French site)

< script type = "text/javascript" >
    var br_data = br_data ||{};

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<domain_key_name>"; # domain_key should change to highlight the active domain the user is on (e.g.example.com or example.com_fr)
    br_data.catalogs = [{"name": "<catalog name>"}]; # The Bloomreach Technical Consultant will provide this; when domain_key changes between example.com and example.com_fr, catalog name will also change.

    (function (){
     var brtrk = document.createElement('script');
     brtrk.type = 'text/javascript';
     brtrk.async = true;
     brtrk.src = 'https:' == document.location.protocol ? "https://cdns.brsrvr.com/v1/br-trk-{{BloomReach Account ID}}.js" : "http://cdn.brcdn.com/v1/br-trk-{{BloomReach Account ID}}.js";
     var s = document.getElementsByTagName('script')[0];
     s.parentNode.insertBefore(brtrk, s);
})(); 
</script> 
< script type = "text/javascript" >

Scenario 2: When there are two catalogs used interchangeably and analytics need not distinguish between the two versions:

< script type = "text/javascript" >
    var br_data = br_data ||{};

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default_value>"; # domain_key should remain default for ALL pixels
    br_data.catalogs = [{"name": "<catalog_name_being_viewed>"}]; # catalogs.name value will change based on which of the domain_key / catalogs are being viewed; e.g. if catalog_product_1 is being viewed then you would pass that, if catalog_product_2 is being viewed then pass that; this will ensure the visit doesn't break when the customer switches the catalog being used to power the site.

    (function (){
    var brtrk = document.createElement('script');
    brtrk.type = 'text/javascript';
    brtrk.async = true;
    brtrk.src = 'https:' == document.location.protocol ? "https://cdns.brsrvr.com/v1/br-trk-{{BloomReach Account ID}}.js" : "http://cdn.brcdn.com/v1/br-trk-{{BloomReach Account ID}}.js";
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(brtrk, s);
})(); 
</script> 
< script type = "text/javascript" >

Site Versions: Multiple

Solution: Product and Content

Views: Single

Domain Keys: Multiple

Scenario 1: When you want analytics to distinguish between the two sites (e.g. when you are moving from an English site to a French site)

 

Assume example.com has two tabs on search - products and content; currently you are on products tab.

   br_data.acct_id = "1234";
   br_data.ptype = "search";
   br_data.search_term = "omelette";
   br_data.domain_key = "example.com"; # domain_key should change to highlight the active domain of the user (e.g.example.com)
   br_data.catalogs = [{"name": "example.com_products"}]; # should include the name of your products catalog.

Now, user on example.com clicks on the content tab:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "example.com"; # domain_key remains example.com since user is still on the example.com site
    br_data.catalogs = [{ "name": "example.com_content" }]; # catalogs.name will change from the name of the product catalog to the name of the content catalog.

Now, the user navigates away from example.com to example.com / fr and the content search tab reloads:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "example.com_fr"; # domain_key changes to highlight that the user has moved from example.com to example.com_fr
    br_data.catalogs = [{ "name": "example.com_content_fr" }]; # should include the name of the content catalog for French.

If example.com/fr has a setup where product & content catalogs can be viewed on the same page, then:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "example.com_fr"; # domain_key will remain as example.com_fr to indicate the site version the customer is on.
    br_data.catalogs = [{ "name": "example.com_product_fr" },{ "name": "example.com_content_fr" }]; # should include the name of the product and the content catalog being displayed (in this case it is assumed that it 's on the French site).

 

Site Versions: Multiple

Solution: Product Only

Views: Multiple

Domain Keys: Single

Scenario 1: Views are used to power separate sites (e.g. each view is used to designate a different site)

A user is viewing products on example.com's Australia site. Search Page View Pixel should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain.
    br_data.view_id = "AU"; # since customer is using view_id to designate different sites, this field should be populated with the site view that customer is on (this is used to break the visit when the customer switches the site).
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["AU"] }]; # catalogs.view_ids will contain the same value as br_data.view_id = AU which is used to designate the site.

Now, the user switches from the Australia site to the US site and the Search Pixel fires again, it should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = "US";  # since customer is using view_id to designate different sites, this field should be populated with the site view that customer is on (this is used to break the visit when the customer switches the site).
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["US"] }];  # catalogs.view_ids will contain the same value as br_data.view_id = US which is used to designate the site.

Scenario 2: Power different versions of the same site (e.g. a view for logged in users, a view for not logged in users)

A user is viewing products on example.com's site as non-logged in user which displays one view of the products:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = ""; # even though customer is a multisite (has different views of the catalog), they do not ever leave example.com which is why we would leave this field blank
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["NotLoggedIn"] }]; # catalogs.name refers to the catalog of content that the customer is viewing; catalogs.view_ids will contain the version of the products that the customer is viewing.

User now logs in and is shown a different view of the products. Note: they are still on example.com

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = ""; # even though customer has different versions of their site, they do not ever leave example.com which is why we would leave this field blank
    br_data.catalogs = [{"name": "example.com_products", "view_ids": ["LoggedIn"] }]; # catalogs.name refers to the catalog of products that the customer is viewing; catalogs.view_ids will contain the version of the content that the customer is viewing. In this case it has now changed from "NotLoggedIn" to "LoggedIn"

Site Versions: Multiple

Solution: Product and Content

Views: Multiple (only product Catalog has views)

Domain Keys: Single

Scenario 1: Views are used to power separate sites (e.g. each view is used to designate a different site)

A user is viewing products on example.com's Australia site. Search Pixel should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain.
    br_data.view_id = "AU"; # since customer is using view_id to designate different sites, this field should be populated with the site view that customer is on (this is used to break the visit when the customer switches the site).
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["AU"] }]; # catalogs.view_ids will contain the same value as br_data.view_id = AU which is used to designate the site.

Now, the user switches from the Australia site to the US site and the Search Pixel fires again, it should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = "US"; # since customer is using view_id to designate different sites, this field should be populated with the site view that customer is on (this is used to break the visit when the customer switches the site).
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["US"] }]; # catalogs.view_ids will contain the same value as br_data.view_id = US which is used to designate the site.

User now clicks on the "content" tab while on the US site, the search pixel fires again, it should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = "US"; # since customer is using view_id to designate different sites, this field should be populated with the site view that customer is on; here they remain in the US site
    br_data.catalogs = [{ "name": "example.com_content" }]; # name of the content catalog being viewed; note: there is no catalogs.view_ids since the content catalog doesn't have views.

If example.com had a situation of product and content catalogs being showed on the same page, then the search page view pixel should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>";
    br_data.view_id = "US"; # view_id will designate the site that the user is on( in this case it's US)
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["US"]}, {"name": "example.com_content"}]; # includes the product catalog and the version of that product catalog available for view in the US; it also includes the content catalog being displayed.

 Scenario 2: Views are used to power different versions of the same site (e.g. a view for logged in users, a view for not logged in users)

A user is viewing products on example.com's site as non-logged in user which displays one view of the products:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = ""; # even though customer has multiple versions of their catalog, they do not ever leave example.com which is why we would leave this field blank
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["NotLoggedIn"] }]; # catalogs.name refers to the catalog of products that customer is viewing; catalogs.view_ids will contain the version of the content that the customer is viewing

User now logs in and is shown a different view of the products. Note: they are still on example.com

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = ""; # even though customer has multiple versions of their catalog, they do not ever leave example.com which is why we would leave this field blank
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["LoggedIn"] }]; # catalogs.name refers to the catalog of products that customer is viewing; catalogs.view_ids will contain the version of the content that the customer is viewing. In this case it has now changed from "NotLoggedIn" to "LoggedIn"

User now clicks on the content tab as a logged in user (note: there is no views for loggedin vs. not loggedin for the content tab). The content search page view pixel would look like:
   
    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = ""; # even though customer has multiple versions of their catalog, they do not ever leave example.com which is why we would leave this field blank
    br_data.catalogs = [{"name": "example.com_content"}]; # refers to the catalog of content that customer is viewing

Site Versions: Multiple

Solution: Product and Content

Views: Multiple (product and content Catalog both have views)

Domain Keys: Single

Scenario 1: Views are used to power separate sites (e.g. each view is used to designate a different site)

A user is viewing products on example.com's Australia site. Search Pixel should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = "AU"; # since customer is using view_id to designate different sites, this field should be populated with the site view that customer is on (this is used to break the visit when the customer switches the site).
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["AU"] }]; # catalogs.view_ids will contain the same value as br_data.view_id = AU which is used to designate the site.

Now, the user switches from the Australia site to the US site and the Search Pixel fires again, it should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain
    br_data.view_id = "US"; # since customer is using view_id to designate different sites, this field should be populated with the site view that customer is on (this is used to break the visit when the customer switches the site).
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["US"] }];   # catalogs.view_ids will contain the same value as br_data.view_id = US which is used to designate the site.

User now clicks on the "content" tab while on the US site, the search pixel fires again. Let's assume this is a "premium" customer who has a special view for content. In that case, the pixel should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>"; # standard value that remains unchanged since customer only has a single domain.
    br_data.view_id = "US"; # since customer is using view_id to designate different sites, this field should be populated with the site view that customer is on; here they remain in the US site
    br_data.catalogs = [{"name": "example.com_content","view_ids": ["premium"]}]; # catalogs.view_ids will contain the "premium" value to designate the special content being displayed.

If example.com had a situation of product and content catalogs being showed on the same page, then the search page view pixel should look like:

    br_data.acct_id = "1234";
    br_data.ptype = "search";
    br_data.search_term = "omelette";
    br_data.domain_key = "<default domain key>";
    br_data.view_id = "US"; # view_id will designate the site that the user is on (in this case it's US)
    br_data.catalogs = [{ "name": "example.com_products", "view_ids": ["US"]}, {"name": "example.com_content", "view_ids": ["premium"]}]; # catalogs.name includes the product catalog and the version of that product catalog available for view in the US; it also includes the content catalog and the version of that content catalog available for premium customers
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?