Skip to content

Track platform and fallback in fallback URL #766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
Merged

Conversation

thomshutt
Copy link
Contributor

@thomshutt thomshutt commented Jun 4, 2025

User description

This is to tell how many people actually copy and visit via the fallback link


PR Type

Enhancement


Description

  • Include utm_source and utm_medium in fallback link

  • Use platform prop dynamically in URL


Changes walkthrough 📝

Relevant files
Enhancement
BrowserFallback.tsx
Add UTM parameters to fallback link                                           

apps/app/app/create/BrowserFallback.tsx

  • Changed linkToCopy to a template literal
  • Added utm_source query param using platform
  • Added fixed utm_medium=browser_fallback param
  • +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    vercel bot commented Jun 4, 2025

    The latest updates on your projects. Learn more about Vercel for Git ↗︎

    Name Status Preview Comments Updated (UTC)
    pipelines-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:35am

    Copy link

    github-actions bot commented Jun 4, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    URL encoding

    Ensure the platform value is safely encoded when interpolating into the query string (e.g. using encodeURIComponent) to prevent unexpected characters.

    const linkToCopy = `https://daydream.live/?utm_source=${platform}&utm_medium=browser_fallback`;
    Missing tests

    There are no tests verifying that the generated fallback URL contains the correct UTM parameters; consider adding unit tests for link generation.

    const linkToCopy = `https://daydream.live/?utm_source=${platform}&utm_medium=browser_fallback`;

    Copy link

    github-actions bot commented Jun 4, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Security
    Escape utm_source parameter

    Use encodeURIComponent on platform when constructing linkToCopy to ensure the value
    is properly escaped and cannot break the URL structure.

    apps/app/app/create/BrowserFallback.tsx [15]

    -const linkToCopy = `https://daydream.live/?utm_source=${platform}&utm_medium=browser_fallback`;
    +const linkToCopy = `https://daydream.live/?utm_source=${encodeURIComponent(platform)}&utm_medium=browser_fallback`;
    Suggestion importance[1-10]: 4

    __

    Why: Using encodeURIComponent ensures the platform value is properly escaped in the URL, although platform is already restricted to literal types, so the improvement is minor.

    Low

    @thomshutt thomshutt merged commit a31d6e3 into main Jun 4, 2025
    6 checks passed
    @thomshutt thomshutt deleted the fallback-tracking branch June 4, 2025 10:42
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant