Phase 1 complete: - move purchase event to order confirmation after successful payment - add backend purchase payload builder for transaction and ticket lines - remove premature purchase push from przelewy24 redirect view
3.5 KiB
3.5 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, duration, started, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | duration | started | completed | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-purchase-data-layer | 01 | payments |
|
|
|
|
|
|
|
6min | 2026-04-19T20:21:00+02:00 | 2026-04-19T20:27:00+02:00 |
Phase 1 Plan 1: Purchase Data Layer Summary
Purchase tracking now triggers only after confirmed payment and sends an enriched ecommerce payload from backend data.
Performance
| Metric | Value |
|---|---|
| Duration | 6 min |
| Started | 2026-04-19T20:21:00+02:00 |
| Completed | 2026-04-19T20:27:00+02:00 |
| Tasks | 3 completed |
| Files modified | 3 |
Acceptance Criteria Results
| Criterion | Status | Notes |
|---|---|---|
| AC-1: Event tylko po potwierdzeniu platnosci | Pass | Event moved to order-confirm.php and injected only when backend provides payload for successful payment. |
| AC-2: Pelny payload ecommerce | Pass | Payload includes transaction fields plus ticket item lines (product_id, name, quantity, price, date_visit). |
| AC-3: Brak falszywych eventow | Pass | purchase push removed from przelewy24.php (pre-payment redirect page). |
Accomplishments
- Added
buildPurchaseDataLayer()in controller to centralize event payload mapping. - Passed payload to confirmation view and emitted safe
dataLayer.pushwith defensivewindow.dataLayerinitialization. - Removed premature
purchasepush from payment gateway handoff template.
Task Commits
No git commits were created in APPLY (working tree changes only).
Files Created/Modified
| File | Change | Purpose |
|---|---|---|
autoload/controls/class.Tickets.php |
Modified | Added purchase payload builder and passed payload to order confirmation view. |
templates/tickets/order-confirm.php |
Modified | Added safe and conditional purchase data layer push. |
templates/tickets/przelewy24.php |
Modified | Removed purchase event from pre-payment step. |
Decisions Made
| Decision | Rationale | Impact |
|---|---|---|
Emit purchase on order_confirm |
This view reflects confirmed payment state rather than payment initiation. | Prevents false positive conversions in analytics. |
| Build payload in backend | Keeps view simple and avoids fragile inline data mapping logic. | Better maintainability and safer output handling. |
Deviations from Plan
None. Plan executed as specified.
Issues Encountered
| Issue | Resolution |
|---|---|
| None | - |
Next Phase Readiness
Ready:
- Purchase event now has a stable post-payment trigger point.
- Payload mapping can be extended later with additional ecommerce fields if needed.
Concerns:
- Manual end-to-end checkout verification in browser/Tag Assistant still pending.
Blockers:
- None
Phase: 01-purchase-data-layer, Plan: 01 Completed: 2026-04-19