Skip to content

Add campaign tracking for bridge reports via cookie-based origin tracking - #12

Draft
AlwinEgger with Copilot wants to merge 5 commits into
mainfrom
copilot/add-campaign-tracking-feature
Draft

Add campaign tracking for bridge reports via cookie-based origin tracking#12
AlwinEgger with Copilot wants to merge 5 commits into
mainfrom
copilot/add-campaign-tracking-feature

Conversation

Copilot AI commented Feb 3, 2026

Copy link
Copy Markdown

Implements campaign tracking to attribute bridge reports to specific marketing campaigns. Users arriving via campaign links (QR codes, promotional materials) have their origin code persisted and attached to subsequent bridge submissions.

Implementation

Frontend

  • Campaign landing route (/campaign/:code) - stores code in 30-day cookie, redirects after 5s
  • Campaign results route (/campaign/:code/results) - queries Parse for bridge count by campaign code
  • Cookie utility with SameSite=Lax and conditional Secure flag (HTTPS only)
  • Modified BridgeForm to attach campaignCode field when cookie present

Backend

  • Added SPA routes for /campaign/:code and /campaign/:code/results

Database

  • Bridge schema extended with optional campaignCode string field

Usage

Generate campaign URL:

https://untendurch.prolutra.ch/campaign/SUMMER2024

Query results:

https://untendurch.prolutra.ch/campaign/SUMMER2024/results

Cookie persists across sessions for 30 days. Bridges without campaign cookies save normally (no breaking changes).

See CAMPAIGNS.md for complete documentation and workflow examples.

Original prompt

This section details on the original issue you should resolve

<issue_title>Campaign tracking: Code in special link is stored on new data, controlling possible</issue_title>
<issue_description>Untendurch needs an extension for campaigns. If a visitor arrives clicking a campaign links (or scanning a qr-code containing this link) this origin is saved as a cookie and provided when storing new data entries (bridges). This makes it possible to fetch the current campaign result on a special controlling page.

What needs to be done?

  1. Landing-page with a code as parameter (URL in QR-code and links). Maybe some small text (hardcoded).
  2. Code is stored as cookie on visitors machine
  3. When entering data (bridge) the code is saved as origin to this data set
  4. Campaign controlling-page witch code as parameter and small text (hardcoded) and the number of data sets entered with that code
    </issue_description>

<agent_instructions>Provide a solution as simple as possible. Describe the solution in a CAMPAIGNS.md file on root. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 3, 2026 08:40
…results page

Co-authored-by: AlwinEgger <4997364+AlwinEgger@users.noreply.github.com>
Co-authored-by: AlwinEgger <4997364+AlwinEgger@users.noreply.github.com>
… and messaging clarity

Co-authored-by: AlwinEgger <4997364+AlwinEgger@users.noreply.github.com>
…y, Secure flag)

Co-authored-by: AlwinEgger <4997364+AlwinEgger@users.noreply.github.com>
Copilot AI changed the title [WIP] Add campaign tracking for visitor origin with cookie storage Add campaign tracking for bridge reports via cookie-based origin tracking Feb 3, 2026
Copilot AI requested a review from AlwinEgger February 3, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Campaign tracking: Code in special link is stored on new data, controlling possible

2 participants