Skip to content

Adding new topics for custom event handling#952

Open
erikmarr wants to merge 3 commits into
releasefrom
em_PREX-2242
Open

Adding new topics for custom event handling#952
erikmarr wants to merge 3 commits into
releasefrom
em_PREX-2242

Conversation

@erikmarr

@erikmarr erikmarr commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings July 16, 2026 16:51
@erikmarr erikmarr self-assigned this Jul 16, 2026
@erikmarr erikmarr added the major-update Significant original updates to existing content label Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds new documentation pages and navigation entries to help merchants who substitute or bypass AEM Commerce drop-ins understand which Adobe Client Data Layer (ACDL) events they must publish manually to preserve commerce analytics instrumentation.

Changes:

  • Adds a new how-to tutorial for instrumenting commerce events without drop-ins, including a reusable helper-script example.
  • Adds a new “Custom events reference” page enumerating ACDL events emitted by drop-ins and their required contexts.
  • Updates existing docs and the sidebar navigation to link to the new tutorial and reference.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/content/docs/how-tos/instrument-commerce-events.mdx New tutorial describing a helper-script approach for publishing ACDL commerce events without drop-ins.
src/content/docs/dropins/all/extend-or-create.mdx Adds a section warning that substituted drop-ins must re-implement ACDL instrumentation, linking to the new docs.
src/content/docs/dropins/all/custom-events.mdx New reference page listing drop-in-emitted ACDL events and required contexts.
astro.sidebar.mjs Adds sidebar links to the new tutorial and custom events reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import Task from '@components/Task.astro';
import Link from '@components/Link.astro';

If your storefront doesn't use the AEM Commerce drop-ins — or replaces one with a custom block — you lose the automatic [Adobe Client Data Layer (ACDL)](/setup/analytics/instrumentation/#adobe-client-data-layer-acdl) instrumentation that the drop-ins provide. This tutorial shows you how to publish the same commerce events yourself using a small helper script, so that analytics, personalization, Live Search, Product Recommendations, and Adobe Experience Platform (AEP) forwarding keep working.
Comment on lines +238 to +248
// Triggered when a product is added to the cart
export function publishAddToCartEvent(items, cartDetails = {}) {
setShoppingCartContext(items, cartDetails);
pushEvent(events.ADD_TO_CART);
}

// Triggered when a product page is viewed
export function publishProductPageViewEvent(product) {
setProductContext(product);
pushEvent(events.PRODUCT_PAGE_VIEW);
}

**Suggested file:** `blocks/product-details/product-details.js` _(the appropriate location depends on your project's structure)_

Call this function after a successful response from your add-to-cart API, passing the item being added to the cart:
Comment on lines +327 to +328
// Called on button click — in production this fires after your add-to-cart API responds
publishAddToCartEvent([sampleCartItem]);
Comment on lines +41 to +42
"@adobe/magento-storefront-event-collector": "^1.17.0",
"@adobe/magento-storefront-events-sdk": "^1.17.0"
bdenham added 2 commits July 16, 2026 12:25
Resolves conflict in astro.sidebar.mjs by adopting release's restructured
sidebar (Boilerplate Updates, Licensing, Storefront Configuration, Go Live,
Tutorials sections) and dropping the branch's now-superseded duplicate entries.
The new instrument-commerce-events topic wasn't linked in the Tutorials section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major-update Significant original updates to existing content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants