A Sitecore module to allow analytics to be posted into xDB asynchronously This is built against Sitecore Experience Commerce 9.2
Currently the Sitecore.Commerce.ExperienceAnalytics.dll doesn't exist in the Sitecore nuget feed. This is a required reference for this project. To build the solution, copy your Sitecore.Commerce.ExperienceAnalytics.dll from your bin directory to the lib folder in the root of this solution. You can then build and deploy the two web projects to your wwwroot folder.
Item serialistion is handled via TDS and is using YAML format.
You will then need to configure this for your site, by including the Javascript elements onto your page. The instructions below will demonstrate how to achieve this with Habiatat Home, but the item locations for your site will be different.
- Add the AjaxAnalytics Extension theme located at /sitecore/media library/Extension Themes/AjaxAnalytics Extension to your site theme (in HabitatHome.Commerce this is located at /sitecore/media library/Themes/Habitat SXA Sites/Habitat Home Store).
- Update your sites available renderings to enable the GTM renderings. (In HabitatHome update the /sitecore/content/Habitat SXA Sites/Global/Presentation/Available Renderings/Analytics item's renderings fields to referance both /sitecore/layout/Renderings/Feature/Analytics/Google Tag Manager Head & /sitecore/layout/Renderings/Feature/Analytics/Google Tag Manager Body to enable this for all sites)
- Open your MetaData Partial Design (In HabitatHome we're going to update the global meta data to include the functionality on all sites, this is located at /sitecore/content/Habitat SXA Sites/Global/Presentation/Partial Designs/Global Metadata) in the Experience Editor.
- Add the Google Tag Manager Head rendering (located under Analytics in the toolbox) to the head placeholder. Enter your Google Tag Manager Container Id into the Key field on the Rendering parameters.
- Add the Google Tag Manager Body rendering (located under Analytics in the toolbox) to the body placeholder. Enter your Google Tag Manager Container Id into the Key field on the Rendering parameters.
- Save your changes to the Meta Partial Rendering, then publish your site.
You're now ready to start triggering events via GTM!