Skip to content

Merging to release-5.8: Testing removing existing Cookie and adding Cookiebot - note using te… (#6486) #6494

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

Conversation

buger
Copy link
Member

@buger buger commented Jun 4, 2025

User description

Testing removing existing Cookie and adding Cookiebot - note using te… (#6486)

  • Testing removing existing Cookie and adding Cookiebot - note using test GTM at the moment do not out live

  • switching to production GTM

  • removing old files and references to them


Co-authored-by: Leonid Bugaev [email protected]


PR Type

Enhancement


Description

  • Removed legacy cookie notice and related scripts

  • Updated Google Tag Manager (GTM) to always load asynchronously

  • Simplified GTM logic by removing cookie consent checks

  • Updated GTM container ID usage for consistency


Changes walkthrough 📝

Relevant files
Enhancement
cookie.js
Remove cookie consent JavaScript logic                                     

tyk-docs/static/js/cookie.js

  • Removed the entire cookie banner JavaScript logic
  • No longer handles cookie consent or banner display
  • +0/-21   
    baseof.html
    Remove cookie notice and update GTM noscript                         

    tyk-docs/themes/tykio/layouts/_default/baseof.html

  • Updated GTM noscript iframe (minor formatting)
  • Removed inclusion of the cookie notice partial
  • +2/-9     
    cookie_notice.html
    Delete cookie notice HTML partial                                               

    tyk-docs/themes/tykio/layouts/partials/cookie_notice.html

  • Deleted the entire cookie notice HTML partial
  • Removed all markup and script for cookie consent UI
  • +0/-20   
    head_tracking.html
    Simplify and always-enable GTM script loading                       

    tyk-docs/themes/tykio/layouts/partials/head_tracking.html

  • Replaced conditional GTM script with always-on async GTM
  • Removed logic checking for cookie consent before loading GTM
  • Updated GTM script for simplicity and reliability
  • +7/-14   

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • #6486)
    
    * Testing removing existing Cookie and adding Cookiebot - note using test GTM at the moment do not out live
    
    * switching to production GTM
    
    * removing old files and references to them
    
    ---------
    
    Co-authored-by: Leonid Bugaev <[email protected]>
    
    (cherry picked from commit 0dd3b7d)
    @buger buger enabled auto-merge (squash) June 4, 2025 11:08
    Copy link
    Contributor

    github-actions bot commented Jun 4, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis ✅

    6486 - PR Code Verified

    Compliant requirements:

    • Replace existing Google Tag Manager (GTM) container IDs with new ones.
    • Remove conditional GTM loading based on cookie consent.
    • Comment out or remove the legacy cookie notice partial.
    • Update GTM script to always load asynchronously.
    • Remove legacy cookie notice and related scripts.
    • Simplify GTM logic by removing cookie consent checks.
    • Update GTM container ID usage for consistency.

    Requires further human verification:

    • Add a preview link (process requirement, not code).
    • Review AI PR Agent suggestions (process requirement, not code).
    • Add Jira DX PR ticket to the subject (for Tyk Members, process).
    • Add appropriate release labels (for Tyk Members, process).
    • Start changes from latest master (for new contributors, process).
    • Review contribution guidelines (for new contributors, process).
    • Review technical guidelines (for new contributors, process).
    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Consent Handling Removal

    The removal of conditional GTM loading based on cookie consent means GTM will always load, which may have privacy or compliance implications. Review if this aligns with current privacy requirements.

    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-NVX4PCL');</script>
    <!-- End Google Tag Manager -->
    Legacy Cookie Notice Removal

    The legacy cookie notice partial and related scripts have been removed. Confirm that this does not break any required user notifications or compliance obligations.

    <!-- Footer scripts -->
    {{ partial "footer_scripts.html" . }}
    
    <!-- Ask AI Chat -->
    {{ partial "ai-chat-widget.html" . }}
    <script defer src="{{ "js/chat.js" | relURL }}"></script>
    

    Copy link
    Contributor

    github-actions bot commented Jun 4, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Security
    Restore user consent check for GTM

    Loading Google Tag Manager without user consent may violate privacy regulations.
    Consider restoring a consent check before initializing GTM to avoid tracking users
    who have not opted in.

    tyk-docs/themes/tykio/layouts/partials/head_tracking.html [3-7]

    -<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    -new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    -j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    -+'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    -})(window,document,'script','dataLayer','GTM-NVX4PCL');</script>
    +<script>
    +  if (!localStorage.getItem("cookieDisabled")) {
    +    (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    +    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    +    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    +    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    +    })(window,document,'script','dataLayer','GTM-NVX4PCL');
    +  }
    +</script>
    Suggestion importance[1-10]: 9

    __

    Why: This suggestion addresses a critical privacy and compliance issue by restoring a user consent check before loading Google Tag Manager, which is essential for adhering to privacy regulations and respecting user choices.

    High

    Copy link

    netlify bot commented Jun 4, 2025

    PS. Add to the end of url /docs/nightly

    Name Link
    🔨 Latest commit 760cc7b
    🔍 Latest deploy log https://app.netlify.com/projects/tyk-docs/deploys/6840293a024c6600080da140
    😎 Deploy Preview https://deploy-preview-6494--tyk-docs.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify project configuration.

    1 similar comment
    Copy link

    netlify bot commented Jun 4, 2025

    PS. Add to the end of url /docs/nightly

    Name Link
    🔨 Latest commit 760cc7b
    🔍 Latest deploy log https://app.netlify.com/projects/tyk-docs/deploys/6840293a024c6600080da140
    😎 Deploy Preview https://deploy-preview-6494--tyk-docs.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify project configuration.

    @buger buger merged commit 6b0f75b into release-5.8 Jun 4, 2025
    11 checks passed
    @buger buger deleted the merge/release-5.8/0dd3b7d04e7bf00e9868d1cfd20ea8b8f90d9035 branch June 4, 2025 11:23
    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.

    2 participants