MP Web Engagement — Phase 1 Test (v2: MP-native FKs)
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.
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
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:
- Browser DevTools → Network tab — look for
/widgets/api/CustomWidgetrequests; check status codes - If 404 on the vanity host: switch
API_HOSTin the script below to the cloud-subdomain prefix - If 401/403:
03-register-procedure.sqldidn't fully run; verify bothdp_API_Proceduresanddp_Role_API_Proceduresrows exist - If 500 with FK violation: a
data-mp-*-idattribute references a non-existent record. Either NULL it out or fix the value. - If CORS error: pjcrusadersdev origin may not be on MP's allowlist — investigate the actual error in the console