Skip to content

Comments

[docs] Add API documentation and analytics integration example to README#53

Merged
FentPams merged 5 commits intov2from
readme-update-apis-analytics
Aug 12, 2025
Merged

[docs] Add API documentation and analytics integration example to README#53
FentPams merged 5 commits intov2from
readme-update-apis-analytics

Conversation

@FentPams
Copy link
Contributor

@FentPams FentPams commented Aug 8, 2025

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@FentPams FentPams changed the base branch from main to v2 August 8, 2025 00:12
@codecov
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@FentPams FentPams requested a review from ramboz August 12, 2025 20:44
Copy link
Contributor

@ramboz ramboz left a comment

Choose a reason for hiding this comment

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

❤️ Love it!

README.md Outdated
Comment on lines 198 to 199
1. **Global Objects** - Access complete experiment details after page load
2. **Events** - React immediately when experiments are applied (V2 only)
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpicking: I'd swap them since you list them in the other order below

README.md Outdated
Comment on lines 303 to 310
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');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about that one. do we have official docs that has it like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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()
      }
    }
  });
}

@FentPams FentPams requested a review from ramboz August 12, 2025 23:07
@FentPams FentPams merged commit a21b2d8 into v2 Aug 12, 2025
4 checks passed
@FentPams FentPams deleted the readme-update-apis-analytics branch August 12, 2025 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants