[docs] Add API documentation and analytics integration example to README#53
[docs] Add API documentation and analytics integration example to README#53
Conversation
…s integration examples
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
README.md
Outdated
| 1. **Global Objects** - Access complete experiment details after page load | ||
| 2. **Events** - React immediately when experiments are applied (V2 only) |
There was a problem hiding this comment.
nitpicking: I'd swap them since you list them in the other order below
README.md
Outdated
| if (window.s) { | ||
| s.eVar1 = experiment; | ||
| s.eVar2 = variant; | ||
| s.events = "event1"; | ||
| s.linkTrackVars = "eVar1,eVar2,events"; | ||
| s.linkTrackEvents = "event1"; | ||
| s.tl(true, 'o', 'Experiment Applied'); | ||
| } |
There was a problem hiding this comment.
Not sure about that one. do we have official docs that has it like that?
There was a problem hiding this comment.
There was a problem hiding this comment.
AppMeasurement.js is the legacy way of doing Analytics instrumentations. Now people rather rely on Launch + AEP WebSDK instead. The Analytics extension is also the "old" way to do that in Launch.
The modern way in WebSDK (alloy.js) would be https://experienceleague.adobe.com/en/docs/analytics/implementation/aep-edge/data-var-mapping, but that doesn't have experimentation support.
I think it would be rather something like:
// Function to track experiment exposure
function trackExperiment(experimentId, variantId, experimentName, variantName) {
alloy("sendEvent", {
xdm: {
eventType: "decisioning.propositionDisplay",
timestamp: new Date().toISOString(),
// Tracks at AEP level
_experience: {
decisioning: {
propositions: [{
id: experimentId,
scope: "page",
items: [{
id: variantId,
schema: "https://ns.adobe.com/personalization/default-content-item"
}]
}],
propositionEventType: {
display: 1
}
}
}
},
data: {
// Tracks in custom Analytics mapping
experiment: {
id: experimentId,
name: experimentName,
variant: {
id: variantId,
name: variantName
},
timestamp: Date.now()
}
}
});
}
Description
Added detailed API documentation and integration examples for analytics platforms to the README, making it easier for customers to integrate the experimentation plugin with their analytics solutions.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: