Analytics Reporting Integration in SGJC

To record analytics events in SGJC (SiteGenesis Javascript Controllers), you must add certain templates to your application. These templates call B2C Commerce processes that capture the data and report on it via the Business Manager user interface.

SGJC uses session IDs to capture web activities for this analytics data. While this doesn't distinguish between visits and visitors (unique visits), it does circumvent the issue with users blocking cookies or not allowing JavaScript and therefore not being counted.

You can capture this information by including the appropriate reporting template on a page. This template triggers a request to the server (via a URL include) with the required parameters.

When you include the appropriate reporting template on a page, the template triggers a request to the server (via a URL include) with the required parameters.

Note: B2C Commerce ignores reporting (log) entries that originate from pages that have been processed using the RedirectURL-Start pipeline (URL mappings).
Important: Don't use the ReportingEvent-Start pipeline as a pipeline trigger. There are some explicit checks for it in the Web Adapter and the requests for that pipeline don't propagate to B2C Commerce. See A/B Test Participation Triggers.

See Analytics.

Reporting Hooks

The following SiteGenesis templates include reporting hooks (SiteGenesis Storefront Core: cartridge/templates/default/util/reporting):

CAUTION:
Don't change the locale in these templates. These templates merely log the information into the analytics log file. The customer will never see it and the analytics module expects en_US.

ReportABTesting.isml

This template must be referenced via an include in a template that appears to the user as a result of the test segmentation / alternate page. For example:

<isinclude template="util/reporting/ReportABTesting.isml"/>.

Variables are passed in the SiteGensis application to the ReportingEvent-Start.xml pipeline that this template expects

ReportBasket.isml

This template, referenced via an include, logs events that indicate the creation or use of a basket (cart). For example:

<isinclude template="util/reporting/ReportBasket.isml" />

Use the parameters to collect:

In SiteGenesis, this include is in the cart.isml and minicart.isml templates.

ReportCheckout.isml

This template logs a checkout event. It logs the step, depending on the parameters, and expects the step number and name as parameters in the scope of a page. Make sure that steps can be ordered alphabetically so that they appear correct in the report. The reporting funnel display will use the step value to show the steps in ascending order. Using the name improves the display. This template can be called using an include, for example:

<isinclude template="util/reporting/ReportCheckout.isml"/> 
Use the parameters in this template to collect checkout information.

You can give each step a meaningful name for the checkout funnel name by changing the pdict variable checkoutname. You must report the steps in the correct sequence with the checkoutstep variable. For example, if you only have three steps in your checkout, they must be reported with the values one, two, and three. If you report with values one, two, and five, the funnel report will insert steps three and four with the same values as five.

In SiteGenesis, the modues.isml template references the ReportCheckout.isml template directly. It doesn't use an include.

ReportOrder.isml

This template logs the total amount of orders made by a customer. This template is called using an include, for example:

<isinclude template="util/reporting/ReportOrder.isml"/> 

Use the parameters to collect:

In SiteGenesis, the include is in the confirmation.isml template.

ReportSearch.isml

B2C Commerce first determines if this is the first search request or a drill down on refinement attributes. B2C Commerce only logs initial searches, not refinements. This template can be called using an include, for example:

<isinclude template="util/reporting/ReportSearch.isml"/>

Use the parameters to collect information on initial searches.

In SiteGenesis, the include is in the categoryproducthits.isml, foldercontenthits.isml, nohits.isml templates.

ReportSourceCodes.isml

B2C Commerce logs a source code if it exists in the session. You must place this template on every page that can be a redirect result of an incoming source code to the session or visit. You can also place this template on every page, or as part of the minicart, which is part of every page.

This template can be called using an include, for example:

<isinclude template="util/reporting/ReportSourceCodes.isml"/>

Use the parameters to collect information on:

In SiteGenesis, the include is in the ReportBasket.isml, ReportOrder.isml, ReportBasket.isml, and redirect.isml templates.

ReportUserRegistration.isml

B2C Commerce tracks user registration by assigning each iteration of AccountOpen with a unique ID and then counting its occurrence, no matter where it occurs in the storefront, using the parameters listed in the template.

This template can be called using an include, for example:

<isinclude template="util/reporting/ReportUserRegistration.isml"/>

In SiteGenesis, the include is in the footer.isml templates.

Related Links

Analytics

Analytics Metrics Definitions

Analytics Reporting Integration

Analytics Reporting Integration Events

Analytics Reporting Integration URL Patterns

Analytics Reporting Integration in SFRA