Adobe Analytics Integration

Enable Adobe Analytics in SearchBlox Search Template

Analytics is enabled when the field 'enableAnalytics' is made true in the custom UI template facet.js file
"enableAnalytics":true
Facet.js file path: https://{server-domain}/{search_UI_name}/facet.js
Or
Enabled through widget code in index.html by input hidden tag
<input type="hidden" id="sb_enable_analytics" value="true"/>

🚧

This integration can be supported with SearchBlox custom UI search templates upon request. Please contact [email protected] to know more.

To Track Analytics when User Performs Search

Once a user performs a search, we will track keywords all the time and if the search is successful we will pass with search result events 'event1'

window.marTech.trackState({
pageName: "SB|search_results",
searchType: "internal_search",
searchTerm: search_term,
events: "event1" 
});

And if the search is unsuccessful (when no results displayed) we will pass without search result events 'event1,event2'

window.marTech.trackState({
pageName: "SB|search_results",
searchType: "internal_search",
searchTerm: search_term,
events: "event1,event2"
});
  • Here, the 'searchTerm' is a search query that is captured with all lowercase and space replaced with an underscore.

Note: These values are passed only when an actual search occurs and a new search term is entered, not when the page reloads or the same search term is used consecutively.

To Track Analytics when User clicks on any Search UI Tab

Once a user lands on the search results page and clicks on tabs, we will track fields to the 'trackAction' function of the Martech Object.

window.marTech.trackAction({
pageName: "SB|search_results",
linkType: "interaction",
linkPage: "SB|search_results",
linkPosition: "search_results",
events: "event49,event52",
linkName: tab_name
});
  • Here, 'linkName' property stores a user-clicked tab name that is captured with all lowercase and space, & is replaced with an underscore.

To Track Analytics when a User clicks on Featured Results

Featured Results are supported with or without tabs. When a user clicks a Featured Result title, the relevant fields are tracked using the trackAction function of the marTech object.

window.marTech.trackAction({
pageName: "SB|search_results",
linkType: "navigation",
linkPage: "SB|search_results",
events: "event11,event52",
linkName: featured_result_title,
linkURL: featureresulturl,
linkPosition: tab_name+"|featured_results”
});
  • linkName is the Featured Result title in lowercase, with spaces replaced by underscores.
    linkURL is the Featured Result URL.

  • The linkPosition property stores tab_name|featured_results. The tab name represents the tab where the user sees the Featured Result and is written in lowercase, with spaces and & replaced by underscores.

To Track Analytics when a User clicks on Top Results

We have Top results that come in all Tabs or without Tabbed search display.
Once a user clicks on the Top result title, we will track fields to the 'trackAction' function of the 'marTech' Object.

window.marTech.trackAction({
pageName: "SB|search_results",
linkType: "navigation",
linkPage: "SB|search_results",
events: "event11,event52",
linkName: top_result_title,
linkURL: topresulturl,
linkPosition: "all|top_results"
});
  • Here, 'linkName' property stores the Top Result title with all lowercase and space replaced with an underscore.

  • The property 'linkURL' stores the Top Result URL.

To Track Analytics when the User apply or Reset Filter

Once a user applies or resets filters, we will track fields to the 'trackAction' function of the 'marTech' Object.

window.marTech.trackAction({
pageName:"SB|search_results",
linkType:"interaction",
            linkPage:"SB|search_results",
events:"event49,event52",
linkName:"apply" OR "reset_filter",
linkPosition:"search_results|"+tab_name,
linkExtraInfo: [facetname:filtervalue]
});
  • The linkName property is set to apply when the user applies a filter to the search results.

  • The linkName property is set to reset_filter when the user resets the search results filter.

  • In linkPosition, tab_name represents the tab where the user views the results. Tab names are written in lowercase, with spaces and & replaced by underscores.

  • The linkExtraInfo property contains an array of applied or reset filter details in the format facetname: filtervalue.

To Track Analytics when user clicks on the Search result Title in Tab Sections

If the user interacts with any link across the tabs on the search results page will track the following fields:

window.marTech.trackAction({
pageName:"SB|search_results",
linkPage:"SB|search_results",
linkType: "download" OR "navigation" OR "social" OR "exit",
linkPosition: tab_name|section_name,
linkName: result_title,
linkURL: resulturl,
events: "event12,event52" OR "event11,event52" OR "event13,event52" OR "event51,event52" OR "event56,event52" (based on linkType)
});
  • The linkPosition property is set as tab_name|section_name, based on the specific user interaction. Both the tab name and section name are generated dynamically from the user action.

Eg: If the user interacts with any link on the ALL tab under section we will be triggering this as all|.

We will see the same link under tab too, say if the user interacts with the link here we will pass the value as |.

All lower case with space,& replaced with underscores.

  • The linkName property is the search result title in lowercase, with spaces replaced by underscores.

  • The linkURL property is the search result URL.

  • The linkType property is tracked based on the conditions described below.

  • If the result content type is PDF, DOCX, Word, or Excel, set linkType to download.

  • If the result URL contains any extensions listed in the navigationDomains field of the facet.js file, set linkType to navigation.

  • If the result URL contains keywords such as Facebook, YouTube, or Twitter, set linkType to social.

  • If the search result title or URL contains a mobile number, set linkType to mobile.

  • If none of the above conditions apply, set linkType to *exit

  • Events are based on 'linkType'.

events="event12,event52" - If 'Download' link type is used
events="event11,event52" - If 'Navigation' link type is used
events="event13,event52" - If 'Exit' link type is used
events="event51,event52" - If 'Social' link type is used
events="event56,event52" - If 'Phone' link type is used