Updating the biConfig.xml file

All the configuration information that is used by the analytics tags must be defined in the biConfig.xml file. You must update this file to include information specific to your analytics provider.

About this task

Within <header> and <footer> elements of the biConfig.xml file, you can include any common JavaScript functions or statements that need to be placed in the store JSP files along with the tagging functions.

When you are updating the biConfig.xml file to define the analytics provider configuration, you can set default values for each configuration setting. By setting default values, you can quickly configure multiple stores to use the same configuration for an analytics provider. You can also override any of the default values for an individual store by including a different value in the configuration for the store. For more information, see Configuring default values for an analytics provider.

To update your analytics provider configuration, update the biConfig.xml file in your development environment and then deploy your file to the HCL Commerce enterprise archive (EAR) on your staging or production environment.

HCL Commerce DeveloperWhen you are updating the biConfig.xml file in your development environment, you can use a reload file to help you quickly test configuration changes. By using this reload file, you do not need to continually restart your server to apply configuration changes from the biConfig.xml file.

Procedure

  1. Open the workspace_dir\crs-web\WebContent\WEB-INF\xml\config\bi\biConfig.xml file.
  2. Locate the <biproviders> element.
  3. Within the <biproviders> element, paste the following lines of code:
    <biprovider name="myProvider">
            <header>
            </header>
            <footer>
            </footer>
    </biprovider>
  4. Replace the value myProvider with the name of the analytics provider.
  5. Within the <header> element, place any common JavaScript snippets that you need to include in your store pages before you invoke the tagging functions, as shown in this example:
    <biprovider name="myProvider">        
        <header> 
           <![CDATA[             
               <script type="text/javascript">               
                 /* Header if any */                       
                </script>           
           ]]>        
       </header>
    
  6. Within the <footer> element, place any common JavaScript snippets that you need to include in your store pages after you invoke the tagging functions, as shown in this example:
    <biprovider name="myProvider">
        ...
        ...
            <footer>
                 <![CDATA[
                 <script type="text/javascript">
                  /* Footer if any */
                 </script>
               ]]>
            </footer>
    
  7. Locate the <stores> element.
  8. Within the <stores> element, paste the following lines of code:
    <store storeId="10101" biprovider="myProvider" enabled="true" debug="true">
       <instrumentation>
       </instrumentation>
    </store>
      
    
  9. Set the parameters for the <stores> element.
    storeId
    The ID of the store that you are integrating with an analytics provider.
    biprovider
    The name of the analytics provider that you are integrating with. This name is the same as the name value that is specified in the <biprovider> element near the top of the biconfig.xml file.
    enabled
    A flag that controls whether the analytics tags in the store pages are enabled to send data to the analytics provider. You can set the following values for this flag:
    • true - Analytics tags are enabled.
    • false - Analytics tags are not enabled; analytics data is not sent to the analytics provider.
    debug
    A flag that controls whether debug mode is enabled for the analytics tags. The debug messages display on the web page where the tag is located, generally at the bottom of the page. You can set the following values for this flag:
    • true - Debugging is enabled.
    • false - Debugging is not enabled.
  10. Within the <instrumentation> element, place any instrumentation code.
    For example, code that includes JavaScript libraries or other related tasks specific for the store inside the element, as shown in the following example:
    <store storeId="10101" biprovider="myProvider" enabled="true" debug="true">
        <instrumentation>
            <![CDATA[
               <script type="text/javascript">
                /* Instrumentation code if any */
               </script>
             ]]>
       </instrumentation>
    </store>
      
    
  11. Save the file.
  12. Restart test servers.

Example

The following code is an example of a completed biConfig.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<BIConfiguration>
   <biproviders>
     <biprovider name="myProvider">
        <header>
           <![CDATA[
             <script type="text/javascript">
               /* Header if any */
              </script>
           ]]>
        </header>
        <footer>
           <![CDATA[
             <script type="text/javascript">
              /* Footer if any */
             </script>
           ]]>
        </footer>
     </biprovider>
   </biproviders>
   <stores>
      <store storeId="10101" biprovider="myProvider" enabled="true" debug="true">
         <instrumentation>
            <![CDATA[
               <script type="text/javascript">
                /* Instrumentation code if any */
               </script>
            ]]>
         </instrumentation>
      </store>
   </stores>
</BIConfiguration>