Skip to content

Commit e939aec

Browse files
Patch Every.org widget to forward partner_donation_id to donation URL
The widget v0.4 defines PARTNER_DONATION_ID in its URL params enum but never reads or forwards it. This adds 5 surgical patches (mirroring the existing partnerMetadata pipeline) so partner_donation_id flows from button href → widget config → Every.org donation URL. Also prettifies the widget JS for maintainability and adds OSE patch comments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 62f598a commit e939aec

2 files changed

Lines changed: 9832 additions & 3 deletions

File tree

public/js/everyorg-endowment-button.js

Lines changed: 9830 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/layouts/Layout.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,9 @@ import { OpenPanelComponent } from '@openpanel/astro';
349349
};
350350
const metadataB64 = btoa(JSON.stringify(metadata));
351351
const [base, hash] = href.split('#');
352+
// Inject partner_donation_id (visitor UUID) so the widget forwards it to Every.org
352353
link.setAttribute('href',
353-
base + '&partner_metadata=' + encodeURIComponent(metadataB64)
354+
base + '&partner_donation_id=' + encodeURIComponent(window.__oseVisitorId) + '&partner_metadata=' + encodeURIComponent(metadataB64)
354355
+ (hash ? '#' + hash : ''));
355356
});
356357

0 commit comments

Comments
 (0)