Currently, the Referral Source field in Offer Management is populated exclusively via document.referrer, which is captured automatically by the widget at load time. This works for organic traffic but provides no way for merchants to pass a custom value when traffic originates from an external campaign.
Requested Changes:
Widget — Add an optional
referralSourcestring parameter to theReusely({...})initialization options. If provided, it should override the auto-captureddocument.referrervalue and be stored against the lead/offer record as the referral source.Collect Leads API — Add an optional
referral_sourcestring field to thePOST /api/v3/public/offer/leadsrequest body, allowing programmatic lead capture to include a referral source at submission time.
Expected behavior: The value passed via either method populates the Referral Source column in Offer Management identically to how the auto-captured referrer does today.
Use case: When a recovery link containing a ?campaign= URL parameter is clicked, the widget initialization reads new URLSearchParams(window.location.search).get('campaign') and passes it as referralSource, enabling full campaign-level conversion attribution within Reusely's reporting without relying on external tools.