Adding multiple analytics providers to the biConfig.xml file
Add multiple analytics providers to your store by updating the
<biproviders>
element in your biConfig.xml configuration
file. Indicate the storeId and the analytics provider you would like to use for that store. To save
time, you can also indicate a default analytics provider by updating the
<defaults>
element.
About this task
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 WebSphere Commerce enterprise archive (EAR) on your staging or production environment.
When 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. For more information, see Using a reload file to test the analytics integration configuration.
Procedure
-
Open your existing biConfig.xml configuration file at the following
path:
WCDE_installdir/workspace/WC/xml/config/bi/biConfig.xml
-
Update your biConfig.xml configuration file to reflect the analytics
providers you want to use in the
<biproviders>
element. See the sample biConfig.xml configuration file in the following example. - Save your file.
- Restart the WebSphere Commerce server to apply your changes.
- Optional:
You can override the default values for the
<output>
element to use the configuration for a specific provider.To specify the output section configuration to use for overriding the default values, you need to update the tag configuration in the CommonJSToInclude.jspf file for your store.For example, to update the<cm:output />
tag, locate the following code.
Update the tag to identify the analytics provider to use by including the analytics provider name:<flow:ifEnabled feature="Analytics"> <%-- The CM header tag must be in the <head> tag of the JSP --%> <cm:output section="header" /> </flow:ifEnabled>
Where analytics_provider is the name of the analytics provider that you want to use.<flow:ifEnabled feature="Analytics"> <%-- The CM header tag must be in the <head> tag of the JSP --%> <cm:output section="header" biprovider="analytics_provider" /> </flow:ifEnabled>
Example
<?xml version="1.0" encoding="UTF-8"?>
<BIConfiguration>
1 <biproviders>
1a <biprovider name = "coremetrics">
<header>
<![CDATA[
]]>
</header>
<footer>
<![CDATA[
]]>
</footer>
</biprovider>
1b <biprovider name = "additionalprovider">
<header>
<![CDATA[
]]>
</header>
<footer>
<![CDATA[
]]>
</footer>
</biprovider>
</biproviders>
2 <defaults>
<store storeId = "10101">
<biprovider name = "coremetrics"/>
</store>
</defaults>
3 <stores>
3a <store storeId = "10101" biprovider = "coremetrics" debug = "false" enabled = "true">
<clientid>12345</clientid>
<output section = "header">
<![CDATA[
<script language="JavaScript1.1" type="text/JavaScript" src="/wcsstore/coremetrics/v40/eluminate.js"></script>
<script language="JavaScript1.1" type="text/JavaScript" src="/wcsstore/coremetrics/v40/techprops.js"></script>
<script language="JavaScript1.1" type="text/JavaScript" src="/wcsstore/coremetrics/cmdatatagutils.js"></script>
<script language="JavaScript1.1" type="text/JavaScript">
<!--
//cmSetProduction();
//-->
</script>
<script language="JavaScript1.1" type="text/JavaScript">
<!--
]]>
</output>
<output section = "footer">
<![CDATA[
//-->
</script>]]>
</output>
</store>
3b <store storeId = "10101" biprovider = "additionalprovider" debug = "false" enabled = "true">
<output section = "header">
<![CDATA[
<!-- Beginning of additional analytics provider header code -->
<!-- End of additional analytics provider header code -->
]]>
</output>
<output section = "footer">
<![CDATA[
<!-- Beginning of additional analytics provider footer code -->
<!-- End of additional analytics provider footer code -->
]]>
</output>
</store>
</stores>
</BIConfiguration>
- 1 The
<biproviders>
element defines the analytics providers that the store is integrated with. In this example, line 1a defines the first analytics provider as coremetrics and line 1b defines the second analytics provider as additionalprovider. - 2 The
<defaults>
element specifies the store, and which one of the analytics providers in the<biproviders>
element is going to be the default that the store uses. - 3 The
<stores>
element defines details about each of the analytics providers. In this example, there are two<store>
elements, which are defined in lines 3a and 3b: one for coremetrics and another for additionalprovider. In each<store>
element, you must set these parameters:- 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 thebiconfig.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.