HCL Commerce Version 9.1.6.0 or later

Setting up Google Analytics 4

Before you can use Google Analytics 4, you must configure the Google API Console and Google Analytics.

Prerequisites

You must have a Google Analytics account.

Note: These steps are provided for you to set up a Google Analytics 4 property alongside your existing Universal Analytics property.

Configurations for the Google API Console

Complete the following steps to configure the Google API console:
  1. Log into the Google Developers Console.
  2. Select the required project.
  3. Search for and add the Google Analytics Data API to the project and Enable.

Configurations for Google Analytics 4

Complete the following steps to configure Google Analytics 4:
  1. Log into Google Analytics.
  2. Create a Google Analytics 4 new property.
  3. Select the relevant information about your site and click Create.
  4. Go to Property User Management and add the Service account email.
  5. Create a Data Stream.
  6. Add a Stream name and for the Website URL, enter the URL for the associated live store.
  7. Note the Measurement ID for the property. The Measurement ID is required to send store data to Google Analytics.
  8. HCL Commerce Version 9.1.12.0 or laterGo to Configuration > Custom Definitions.
  9. HCL Commerce Version 9.1.12.0 or laterClick Create custom dimensions.
  10. HCL Commerce Version 9.1.12.0 or laterEnter the following to create the required dimensions.
    • Dimension Name: hclMarketplace

      Scope: Event

      Description: The associated marketplace that catalog entries are ordered from in the store.

      Event Parameter: hclMarketplace

    • Dimension Name: hclMarketplaceSeller

      Scope: Event

      Description: Marketplace Seller (Organization)

      Event Parameter: hclMarketplaceSeller

  11. HCL Commerce Version 9.1.13.0 or laterGo to Configuration > Custom Definitions.
  12. HCL Commerce Version 9.1.13.0 or laterClick Create custom metrics.
  13. HCL Commerce Version 9.1.13.0 or laterProvide the following information to create the required metrics.
    • Metric name: search_results
    • Description: The number of search results for a given search term
    • Scope: Event
    • Parameter name: search_results
    • Unit of measurement: Standard
  14. HCL Commerce Version 9.1.13.0 or laterThe data stream created in Step 5 must be updated to track the search term.
    • From the list of data streams, edit the data stream created in Step 5.
    • Go to Events. Click on the settings icon from the Enhanced Measurement section to configure the data stream.
    • From the Enhanced Measurement window, go to Site Search and click on Show advanced settings.
      HCL Commerce Version 9.1.14.0 or laterNote: Skip this step for the Ruby and Ruby B2B store.
    • In the Search Term Query Parameter box, add searchTerm, in front of the list to allow the Google Analytics 4 to start tracking site search.
      HCL Commerce Version 9.1.14.0 or laterNote: Skip this step for the Ruby and Ruby B2B store.