Appearance
What is Givebutter Event Sync?
When you create or update an event campaign in Givebutter, NOMA Sync can create or update a matching event on the NOMA website (WordPress). That event stores the Givebutter campaign code and widget ID so the site can show the registration widget (ticket form) on the event page. Registrations still happen in Givebutter; the webhook then syncs each transaction to LGL.
Flow:
- Givebutter – You publish an event campaign (type
event, with event date). - NOMA Sync – Receives
campaign.createdorcampaign.updated, fetches campaign details and tickets, then calls the WordPress REST API. - WordPress – Creates or updates a
noma_eventspost with title, dates, venue,gb_campaign_id,gb_campaign_code,gb_widget_id, and ticket data. - Site – Event single page loads the Givebutter widget script and renders
<givebutter-widget id="...">or<givebutter-form campaign="...">so visitors can register. - Registrations – Go to Givebutter;
transaction.succeededwebhook → NOMA Sync → LGL (same as other Givebutter donations).
So Givebutter event sync is the leg that keeps the website event listing and registration embed in sync with Givebutter; the donation/ticket → LGL leg is unchanged and documented in Givebutter Overview.
When Does Sync Run?
- Trigger: Givebutter webhook for
campaign.createdorcampaign.updated. - Only event campaigns: Campaign
typemust beevent. - Only published: Campaign
statusmust bepublished(oractive). - Requires event date: Campaign must have
event_datein the Givebutter API response; otherwise sync is skipped with status "skipped".
If WORDPRESS_URL or WORDPRESS_API_KEY is not set in the Worker, WordPress sync is skipped (no error; LGL sync still runs for transactions).
Worker Configuration
Set these Cloudflare Worker secrets (or in .dev.vars for local):
| Variable | Description |
|---|---|
WORDPRESS_URL | WordPress site URL (e.g. https://notonemorealabama.org). No trailing slash. |
WORDPRESS_API_KEY | Secret key that must match the key stored in WordPress (see below). |
WORDPRESS_TIMEZONE | Optional. IANA timezone (e.g. America/Chicago) for converting Givebutter UTC dates to the site timezone. Should match WordPress Settings → General → Timezone. |
WordPress Configuration (hello-noma theme)
- API key: The theme checks the header
X-NOMA-API-Keyagainst the optionhello_noma_sync_api_key. Set this in WordPress (e.g. Settings or a dedicated NOMA Sync settings page) to the same value asWORDPRESS_API_KEYin the Worker. If they don't match, the REST API returns 403 and event create/update fails. - Givebutter widget account: For the registration widget to load on event pages, set the option
givebutter-widget-account(Givebutter account identifier). The theme enqueueshttps://widgets.givebutter.com/latest.umd.cjs?acct={account}in the head on event archive/single so<givebutter-widget>and<givebutter-form>are defined before the React app runs.
WordPress REST Endpoints (NOMA Sync → WordPress)
The Worker calls these; they are implemented in the hello-noma theme. Do not call them from the browser without the API key.
| Method | Route | Purpose |
|---|---|---|
| GET | /wp-json/noma/v1/events/by-campaign/{campaign_id} | Find existing event by Givebutter campaign ID. |
| POST | /wp-json/noma/v1/events/from-givebutter | Create new event (body: campaign_id, title, event_date, venue, tickets, widget_id, etc.). |
| PATCH | /wp-json/noma/v1/events/{id}/from-givebutter | Update existing event. |
All require header: X-NOMA-API-Key: <secret>.
What Gets Stored on the Event (WordPress)
- Post type:
noma_events - Meta (examples):
_gb_campaign_id,_gb_campaign_code,_gb_widget_id,_gb_tickets(JSON),_start_date,_end_date,_venue_name,_venue_address, etc. The theme exposes these on the REST API for the events app; the single-event page usesgb_widget_idorgb_campaign_codeto render the Givebutter embed.
Recurring events (weekly/monthly, WordPress-only, no Givebutter) use separate meta and are documented in Recurring events.
Troubleshooting Event Sync and Widget
| Symptom | What to check |
|---|---|
| No event on site after creating/publishing in Givebutter | Worker: WORDPRESS_URL and WORDPRESS_API_KEY set. Dashboard Syncs: filter by source Givebutter, look for campaign webhook and any "WordPress event sync failed" or "skipped" (e.g. no event_date). |
| 403 on from-givebutter or by-campaign | WordPress option hello_noma_sync_api_key must equal Worker WORDPRESS_API_KEY. Key must be set on both sides. |
| Widget never appears; only "Register on Givebutter" link | WordPress: givebutter-widget-account set so the widget script loads. Event must have gb_widget_id or gb_campaign_code (sync must have run successfully). Browser console: check for script or custom-element errors. |
| Campaign not syncing | Givebutter: campaign type is event, status is published. Givebutter API: campaign has event_date. Worker logs: "Skipping campaign" (type/status) or "Campaign has no event_date". |
| Wrong dates or timezone on event | Set WORDPRESS_TIMEZONE to match WordPress (e.g. America/Chicago). |

