Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Table of Contents

...

Overview

...

The following JavaScript needs to be installed on every page of your site. The block should look as follows. Please either adjust or add as needed. The enginename is the engine ID associated with your Hawksearch account. The ClientGuid is the Tracking Key associated with your account. To lookup the Engine Name and Tracking Key for your account please look in the Hawksearch workbench under Admin >> Account Info.

Code Block
languagehtml
<!-- Hawksearch Header Includes -->
<script type="text/javascript">
  //<![CDATA[
  (function (HawkSearch, undefined) {
    HawkSearch.BaseUrl = 'http://dev.hawksearch.net/sites/%%enginename%%';
    HawkSearch.HawkUrl = HawkSearch.BaseUrl;
    HawkSearch.TrackingUrl = 'http://tracking-dev.hawksearch.net';
    HawkSearch.RecommenderUrl = 'http://recs-dev.hawksearch.net';
    HawkSearch.ClientGuid = '%%tracking_key%%';
    if ("https:" == document.location.protocol) {
    HawkSearch.BaseUrl = HawkSearch.BaseUrl.replace("http://", "https://");
    HawkSearch.HawkUrl = HawkSearch.HawkUrl.replace("http://", "https://");
    HawkSearch.TrackingUrl = HawkSearch.TrackingUrl.replace("http://", "https://");
    HawkSearch.RecommenderUrl = HawkSearch.RecommenderUrl.replace("http://", "https://");
  }
}(window.HawkSearch = window.HawkSearch || {}));
    var hawkJSScriptDoc = document.createElement("script");
    hawkJSScriptDoc.async = true;
    hawkJSScriptDoc.src = HawkSearch.HawkUrl + '/includes/hawksearch.min.js?v1.0';
    var hawkJSTag = document.getElementsByTagName('script')[0]; hawkJSTag.parentNode.insertBefore(hawkJSScriptDoc, hawkJSTag);
    var hawkCSSScriptDoc = document.createElement("link"); hawkCSSScriptDoc.setAttribute("rel", "stylesheet");
    hawkCSSScriptDoc.setAttribute("type", "text/css");
    hawkCSSScriptDoc.setAttribute("href", HawkSearch.HawkUrl + '/includes/hawksearch.css'); document.head.appendChild(hawkCSSScriptDoc);
  //]]>
</script>

...

Step 3: Define the Search Results Layout

Within the <BODY> <body> area of the search page, you must include the following <DIV> empty <div> elements with ids as specified below (initially empty) – the inner HTML of these div tags will be replaced automatically by Hawksearch.:

Code Block
languagehtml
<div id="hawkbannerlefttop" ></div>
<div id="hawkbannerleftbottom" ></div>
<div id="hawkbannertop" ></div>
<div id="hawkfacets"></div>
<div id="hawkbreadcrumb"></div>
<div id="hawkpagecustomhtml"></div>
<div id="hawktoptext"></div>
<div id="hawktabs"></div>
<div id="hawktoppager"></div>
<div id="hawkitemlist"></div>
<div id="hawkbottompager"></div>
<div id="hawkbannerbottom"></div>
<div id="hawkbannerbottom2"></div>
<div id="hawkexplain"></div>
<div id="hawksmartbug"></div>

Details are as follows:

<div id="hawkbannerlefttop" ></div>

...

This <DIV> represents a placeholder for the area on the page where the bread crumb for the search page will be inserted.

<div id="hawkpagecustomhtml"></div>

This <DIV> is used as container for content from Custom HTML field from the Landing Pages. 

<div id="hawktoptext"></div>

...

Step 4: Add the Event Tracking Code

Infonote

NOTE: In order to populate data in the Hawksearch Reports, and to leverage Personalized Search, it is CRITICAL to implement Tracking Integration.

Click here for instructions on adding Hawksearch Event Tracking Code .

...