MP Web Engagement — Phase 1 Test (v2)

MP Web Engagement — Phase 1 Test (v2: MP-native FKs)

What this page tests: the full click → engagement-tracker JS → widget API → api_Custom_LogClick SP → Web_Click_Log INSERT pipeline using the v2 schema with User_ID, Contact_ID, Ministry_ID, Group_ID, Event_ID, and Session_ID. Click any tracked element below; the Event Log shows the SP response. Then run 05-verify-rows.sql in SSMS to confirm rows physically landed.
Auth check: waiting for MP login...

Browser session: (generating...) — same UUID for every click in this tab. Close+reopen the tab to get a new one.

Tracked Test Links

Each link uses the data-mp-* attribute family. The JS reads them at click time and passes the corresponding FK values to the SP. FK values are placeholders — to test real FK attribution, edit the data-mp-ministry-id / data-mp-group-id / data-mp-event-id attributes below to point at actual records in mp-sandbox. Empty/missing attributes pass NULL, which the SP accepts gracefully.

Stewardship Resources Giving History Marriage Prep Baptism Prep This Week's Bulletin Member Directory (no Ministry) SBE Finance Meeting - 26-05-09 (richest example)

Event Log

Initialized — waiting for clicks…
Configuration & data attribute reference

Page-level default: in the document head — applies as Ministry_ID for any tracked element that doesn't have its own override.

Element-level attributes (override page-level for that element):

Attribute Becomes SP param Notes
data-mp-track (presence flag) Required. Marks the element as trackable.
data-mp-ministry-id @Ministry_ID Override the page-level Ministry default.
data-mp-group-id @Group_ID Optional. Tie this click to a specific MP Group.
data-mp-event-id @Event_ID Optional. Tie this click to a specific MP Event.
data-mp-label @Element_Label Optional. Override the default text-content extraction.

If clicks register here but no rows land in Web_Click_Log, check:

  1. Browser DevTools → Network tab — look for /widgets/api/CustomWidget requests; check status codes
  2. If 404 on the vanity host: switch API_HOST in the script below to the cloud-subdomain prefix
  3. If 401/403: 03-register-procedure.sql didn't fully run; verify both dp_API_Procedures and dp_Role_API_Procedures rows exist
  4. If 500 with FK violation: a data-mp-*-id attribute references a non-existent record. Either NULL it out or fix the value.
  5. If CORS error: pjcrusadersdev origin may not be on MP's allowlist — investigate the actual error in the console