Configure default values for an analytics provider

We can configure default values for an analytics provider configuration to apply the default values to all stores associated with the analytics provider. By setting site-level default values, we can quickly configure multiple stores to use the same analytics provider settings. We can also override the default values for an individual store.


Before beginning


Task info

When we are defining the default values for an analytics provider configuration, you set the default values within the <biprovider> element for the analytics provider. We can set default values for the same configuration options available for each store. To override the default values and configure a value specific to one or more stores, we can include the setting with a different value in the <store> configuration for the stores.

As an example, the following steps demonstrate how to configure default values for an integration with IBM Digital Analytics. For more information about configuring an integration with IBM Digital Analytics, see Configure the store to communicate with IBM Digital Analytics(biConfig.xml)


Procedure

  1. Open your existing biConfig.xml configuration file at the following path:
    workspace_dir\crs-web\WebContent\WEB-INF\xml\config\biConfig.xml

    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.

  2. Within the <biproviders> element, add or update the <biprovider> configuration for our analytics provider. For example,

      <biprovider name = "coremetrics">

  3. Within the <biprovider> analytics provider configuration, add one or more of the following attributes or elements and set the default value.

      clientid
      The analytics provider client ID, as provided by the analytics provider.

      enabled
      A flag that controls whether the analytics tags in 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 store 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.

      instrumentation
      This element includes code that is related to the integration between a store and the analytics provider. We can define the default CDATA section within this attribute. For example, code that includes JavaScript libraries or other related tasks specific for the store inside the element, as shown in the following example:

        <instrumentation>
                <![CDATA[
                   <script type="text/javascript">
                    /* Instrumentation code if any */
                   </script>
                 ]]>
           </instrumentation>

      marketingCenterEnabled
      The enablement flag for integrating Management Center with .

      marketingCenterUrl
      If Management Center is integrated with , this element can be used to override the default URL to .

      includeShipAdjustInProductPrice
      The enablement flag that controls whether shipping adjustments are applied to the product prices in an order or to the shipping charge when order data is sent to IBM Digital Analytics. This setting does not affect the order details that a shopper views when they are submitting or reviewing an order.

        true
        The default value. Shipping adjustments are applied to the products in an order instead of being applied to the shipping charge when order data is sent to IBM Digital Analytics. For example, a product costs $40 with a shipping charge of $10. If a promotion that offers a $5 discount on shipping is applied, the order total is $45. When the includeShipAdjustInProductPrice flag is set to true, the order and shopping cart tags send the order data to IBM Digital Analytics. The information that is sent indicates that the order total was $45, the product price $35, not $40, and the shipping charge $10, not $5.

        false
        Shipping adjustments are applied to the shipping charge when data is sent to IBM Digital Analytics. For example, if the includeShipAdjustInProductPrice flag is false in the previous scenario, the information that the order and shopping cart tags send to IBM Digital Analytics indicates that the order total was $45, the product price $40 and the shipping charge was $5.

      options
      This element with a useDDX attribute is used for integrating WebSphere Commerce with IBM Digital Data Exchange (DDX).

      output
      This element includes the JavaScript snippets, or any other content, to write to a specific location in the store pages to track and send analytics data. For example, we can set a default value for the cmSetClientID function settings. We can set the default values for the following cmSetClientID function settings for store production and the test systems.

        Client ID
        The client ID that is provided by the analytics provider. For example, "99999999".

        Data collection method
        The data collection method. We can set one of the following values:

          true
          The data collection is managed by the analytics provider, such as IBM Digital Analytics.

          false
          The data collection is managed by the client for each store.

        Analytics provider domain name
        The domain name for the analytics provider. For example, "data.coremetrics.com".

        WebSphere Commerce server
        The domain name of the WebSphere Commerce server. For example, "thesite.com".

      url
      The URL for launching the analytics provider from Management Center.

      useCookies
      The enablement flag for storing category information in cookies. See Storing category information in cookies for analytics reporting.

      useHostedCMHLibraries
      Indicates whether the store uses the standard IBM Digital Analytics library. We can set the following values for this flag:

      useEmailForCustomerId
      Indicates whether to use an email address instead of a WebSphere Commerce member ID to identify customers in IBM Digital Analytics. You can set the following values for this flag:

      When the value is true, a store requires customers to provide their email address when they register and when they place an order as a guest shopper. Using the customer email address as the customer ID is useful when the email address can be collected consistently when customers set up a new account, sign up to receive a newsletter, or complete some other identifying form. For example, using the email address, we can correlate a customer that completes a product inquiry form on an external site to the same customer that registers with a WebSphere Commerce store. Using the email address can also help you to track multiple orders that are placed by the same guest shopper. When a customer places an order, a guest shopper is assigned a different unique member ID each time; however, the guest shopper's email address is likely to stay the same.

      The customer ID parameter is passed to IBM Digital Analytics in the cmCreateRegistrationTag data tag (which is generated by the <cm:registration /> tag), and in the cmCreateShopAction9 and cmCreateOrderTag data tag (which are both generated by the <cm:order /> tag).

      segmentExportMode
      Indicates the export mode to use when you update IBM Digital Analytics based customer segments. For more information, see tmtconfigsegbiconfig.htm.

  4. Optional: Override the default settings for an individual store or stores that need to use different configuration settings.

    1. Within the <stores> element, add or update the <store> configuration for the stores. Within this configuration, we must associate the store with the analytics provider. If we want a store to use only the default values, you still need to associate the store with the analytics provider by including the following <store> element configuration:

        <store storeId="10101" biprovider="coremetrics">
        ...
        </store>

      Where

        storeId
        The ID of the store or stores that we are associating with an analytics provider. When we are configuring the analytics reporting options for multiple stores, we can apply one configuration to multiple stores by including a list of store ID values. We can also copy the sample configuration to create multiple configurations and apply each configuration to one or more stores. We can specify the storeId value in the following formats:

        1. A single storeId value.

        2. A comma-separated list of storeId values. For example, specify storeId="10000, 10001" to enable IBM Digital Analytics for two stores using the same IBM Digital Analytics client ID and tag library that is defined in the configuration.

        3. A range of storeId values. For example, specify storeId="10000-10200" to enable IBM Digital Analytics for all of the stores that have storeId values that fall within the range that include the specified upper and lower bounds. The stores specified in the range must share the IBM Digital Analytics client ID and tag library that is defined in the configuration.

        biprovider
        The name of the analytics provider. This name is the same as the name value specified in the <biprovider> element.

    2. Within the <store> configuration element, add or update any of the following attributes or elements to override the default values. For the <output> element, we can override the individual configurations within the element.

      • enabled

      • debug

      • instrumentation

      • marketingCenterEnabled

      • marketingCenterUrl

      • options

      • output

      • url

      • useCookies

      • useHostedCMHLibraries

      • useEmailForCustomerId

      • segmentExportMode

    3. Save and close the file. As example, the following sample biConfig.xml sets default values for 5 stores and includes overrides for three stores. two stores include only the configuration to associate the store with the analytics provider.

        <BIConfiguration>
          <ssoKey></ssoKey>
          <biproviders>
            <biprovider name="coremetrics"
              enabled="true" debug="true" 
              marketingCenterEnabled="true"
              useHostedCMHLibraries="true" 
              useEmailForCustomerId="false" 
              segmentExportMode="append" >
              <useCookies>true</useCookies>
              <clientid>69999999</clientid>
              <url>https://welcome.coremetrics.com/analyticswebapp/analytics.jsp</url>
              <marketingCenterUrl>https://mc.coremetrics.com/mcwebapp/welcome.do</marketingCenterUrl>
              <options>
                <attribute name="useDDX" value="true"/>
              </options>
              <output section="header">
                <![CDATA[
                <script type="text/javascript" src="//libs.coremetrics.com/eluminate.js"></script> 
                <script type="text/javascript"> 
                cmSetupNormalization("krypto-_-krypto");
                
                // send data to production system 
                //cmSetClientID("99999999",true,"data.coremetrics.com","thesite.com"); 
                
                // send data to test system 
                cmSetClientID("69999999",false,"testdata.coremetrics.com","thesite.com"); 
                </script> 				
                ]]>
              </output>
              <header>
                <![CDATA[<script type="text/JavaScript">
                <!--
                ]]>
              </header>
              <footer>
                <![CDATA[
                //-->
                </script>]]>
              </footer>
            </biprovider>
          </biproviders>
         
          <stores>
           <store storeId="10101, 10102" 
              biprovider="coremetrics" 
              marketingCenterEnabled="false" >
              <useCookies>false</useCookies>
              <options>
                <attribute name="useDDX" value="true"/>
              </options>
            </store>
            <store storeId="10103" 
              biprovider="coremetrics" 
              marketingCenterEnabled="false"
              useEmailForCustomerId="true" >
              <options>
                <attribute name="useDDX" value="true"/>
              </options>
            </store>
            <store storeId="10104, 10105" biprovider="coremetrics" />
          </stores>
        </BIConfiguration>   

  5. Restart test servers.