Section-based personalization for AEM Edge Delivery Services (DA) pages: Section Metadata rows let rules (geo, device, visitor, URL/UTM param, page state, custom audiences), a decision engine (v1 API, OF1), an A/B split or Adobe Target (inline or popup) pick the EDS fragment a section shows, with the authored content as default. Consent first, measurement events per decision, a client runtime plus an optional Cloudflare edge worker, a simulator and Playwright checks.
88%
Does it follow best practices?
Impact
83%
0.83x1 of 3 eval scenarios. Add 2 more for a full score.
Low
Low-risk findings worth noting
Generated by the personalize skill (aem-eds-personalization plugin). It wraps the official
adobe/aem-cloudflare-prod-worker
(src/aem-worker.mjs, unchanged, Apache-2.0) in src/index.mjs. The wrapper runs after the
origin fetch, so the CDN cache key and the cached HTML stay the same.
What it does:
It decides rules, split and api sections using the same modules as the browser
runtime. It only decides when the pzn-consent=1 cookie is present (the browser copies it
from the consent tool) or when edge-config.js lists an approved exception. Each section
ends up in one of three states:
<template data-pzn-default>.Marked sections carry data-pzn-where="edge", data-pzn-status, and the decision:
data-pzn-variant, -source, -outcome, -reason, -decision, -cached and -tracking.
The browser reads these and sends pzn:decided, pzn:applied and pzn:seen.
It leaves some sections to the browser: target sections, and Rule rows that need
device:, state: or audience:.
It assigns split sections once per browser session, using the pzn-split session
cookie.
It serves crawlers the authored (default) content.
It caches engine answers in a shared cache, keyed only on what the request sends (no
visitor id), for the answer's ttl. Personalized HTML is sent with
Cache-Control: private, no-cache, plus an x-pzn: edge or x-pzn: deferred header.
It runs the server route POST /pzn/decide for browser engine requests. The route:
PZN_API_KEY secret and the engine adapters (api.mapRequest/mapResponse;
OF1 in adapters/of1.js);of1 profile;api exception.| File | Owner |
|---|---|
src/aem-worker.mjs | Adobe. Re-vendor it to upgrade; do not edit it |
src/personalization/{rules,section-spec,outcomes,contract,context,provider-api}.js, src/personalization/sources/split.js | Copied from scripts/personalization/. Re-run install-edge after changing them |
src/personalization/{personalize,html}.js, src/personalization/adapters/of1.js | Skill runtime |
src/personalization/edge-config.js | Site. Keep fragmentPrefixes, consent and api.engine aligned with scripts/personalization/config.js |
The upstream worker only accepts an https://main--*--*.aem.live origin, so run the dev
server over https:
npx wrangler dev --local-protocol https
curl -sk -D - -o /dev/null https://localhost:8787/ # no personalized sections: origin headers, no x-pzn
curl -sk -XPOST https://localhost:8787/pzn/decide -d '{}' # 503 until an engine is set, then 403 without a same-origin OriginA page's personalized sections only reach the origin once its content is published. Before
that, run the edge code over the preview HTML with the skill's simulator. It fakes
request.cf, the consent cookie and the user agent:
node <skill>/scripts/simulate.mjs https://main--<repo>--<owner>.aem.page/<page> --edge --consent --country US
node <skill>/scripts/simulate.mjs https://main--<repo>--<owner>.aem.page/<page> --edge --ua GooglebotDeploying is the site owner's decision. See the launch checklist in the skill output. These commands are for the site owner to run:
npx wrangler secret put PZN_API_KEY # only if a decision engine is used
npx wrangler deploy.tessl-plugin
skills
personalize
assets
reference
scripts
test
fixtures
browser
contract
examples
decision-feedback
decision-request
decision-response
measurement-event
invalid
section
site-config
site
content
scripts
personalization