Repository navigation
Pass ?ref= through to Summit 2026 Pretix widget as campaign code - #1260
Merged
Merged
Conversation
Members share links like ?ref=ISC26-ADADAI so Pretix can credit ticket
orders to their referral campaign. Validates the code against
^ISC26-[A-Z0-9-]{1,40}$ before setting data-campaign; without a ref,
the widget behaves exactly as before.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UsSuPgoXdF4gxEGPgcRjpj
The "buy tickets on Pretix" fallback link lives inside a <noscript> block, which browsers never parse into the DOM when JavaScript is enabled, so the rewrite could never find the element - it's removed rather than kept as no-op code. The campaign attribution itself (data-campaign on the widget) is unaffected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UsSuPgoXdF4gxEGPgcRjpj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Members sharing a Summit 2026 referral link (e.g.
https://innersourcecommons.org/events/isc-2026/?ref=ISC26-ADADAI) now have that code carried into the embedded Pretix ticket widget, so Pretix can credit the resulting order to the member's campaign.layouts/partials/head.htmldefineswindow.pretixWidgetCallback(gated behind.Params.pretixWidget, so only the Summit 2026 page is affected) before the Pretix widget script loads.?ref=from the page URL and, only when it matches^ISC26-[A-Z0-9-]{1,40}$, setsdata-campaignon the<pretix-widget>element.window.PretixWidget.buildWidgets(), with or without a validref, so the widget builds exactly as it does today when norefis present.<noscript>) is left untouched: browsers never parse<noscript>content into the DOM when JavaScript is enabled, so a script-driven rewrite of that link can never actually run, and for JS-disabled visitors there's no?ref=handling happening anyway (the widget itself requires JS).Test plan
hugobuild completes cleanly.?ref=—<pretix-widget>has nodata-campaignattribute, page renders unchanged.?ref=ISC26-TEST—data-campaign="ISC26-TEST"is set, widget still builds.?ref=<script>(invalid) — rejected by the regex, no attribute set, no JS errors.master).Screenshots
Full page,

?ref=has no visible effect on rendering (confirmed pixel-identical across all three test cases above):