Update the biConfig.xml file
All the configuration information used by the analytics tags must be defined in the biConfig.xml file. We must update this file to include information specific to your analytics provider.
Task info
Within <header> and <footer> elements of the biConfig.xml file, we can include any common JavaScript functions or statements that need to be placed in the store JSP files along with the tagging functions.When we are updating the biConfig.xml file to define the analytics provider configuration, we can set default values for each configuration setting. By setting default values, we can quickly configure multiple stores to use the same configuration for an analytics provider. We can also override any of the default values for an individual store by including a different value in the configuration for the store. See Configure 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 WebSphere Commerce enterprise archive (EAR) on the staging or production environment.
(Developer) When we are updating the biConfig.xml file in your development environment, we 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
- Open the
workspace_dir\crs-web\WebContent\WEB-INF\xml\config\bi\biConfig.xml file.- Locate the <biproviders> element.
- Within the <biproviders> element, paste the following lines of code:
<biprovider name="myProvider"> <header> </header> <footer> </footer> </biprovider>
- Replace the value myProvider with the name of the analytics provider.
- Within the <header> element, place any common JavaScript snippets that you need to include in the 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>
- Within the <footer> element, place any common JavaScript snippets that you need to include in the 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>
- Locate the <stores> element.
- Within the <stores> element, paste the following lines of code:
<store storeId="10101" biprovider="myProvider" enabled="true" debug="true"> <instrumentation> </instrumentation> </store>
- Set the parameters for the <stores> element.
- storeId
- The ID of the store that we are integrating with an analytics provider.
- biprovider
- The name of the analytics provider that we are integrating with. This name is the same as the name value 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. We 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. We can set the following values for this flag:
- true - Debugging is enabled.
- false - Debugging is not enabled.
- 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>
- Save the file.
- 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>
Previous topic: Creating a tag library definition file
Next topic: Tagging the store pages for the external analytics system
Related tasks
Adding multiple analytics providers to the biConfig.xml file