Remove cookie consent banner
I am implementing Adsense and Google automatically injects me its own Cookie consent banner. I would like to make the Wasp CookieConsentBanner from the OpenSaas template not to appear.
16 Replies
Hi @NEROX. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I apologize, but I don't have enough specific information in the provided knowledge sources to directly answer how to remove the CookieConsentBanner from the OpenSaaS template in Wasp. The documents don't contain details about this particular component or how to disable it.
However, I can provide some general guidance based on typical React and Wasp practices:
1. Look for the CookieConsentBanner component in your project files, likely in the
src/client
directory.
2. You might be able to conditionally render the banner or simply remove its import and usage from your main layout or App component.
3. If you need more customization options for components like this, you might be interested in an ongoing effort to make Wasp's components more flexible. There's an open issue about this: GitHub Issue #1617 (https://github.com/wasp-lang/wasp/issues/1617).
If you need more specific help, I recommend reaching out to the Wasp community on Discord (https://discord.gg/rzdnErX) or via email at [email protected] (https://wasp-lang.dev/cdn-cgi/l/email-protection#31595871465042411c5d505f561f555447) as mentioned in the contact documentation (https://wasp-lang.dev/docs/contact).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @NEROX, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Solved✅
Unsolved again❌
I have lost Analytics tracking,
I have reverted changes.
@kapa.ai How can I remove the cookieConsentBanner without losing my Analytics tracking. The analytics script must run everytime
Let me check the knowledge base for you again. One moment! :books:
----------------------
I apologize, but I don't have specific information in the provided knowledge sources about removing the cookieConsentBanner while maintaining analytics tracking in the OpenSaaS template for Wasp. The documents don't contain details about this particular component or how to modify it.
However, based on general web development practices, here are some suggestions:
1. You might be able to modify the cookieConsentBanner component to always consider consent as given, allowing the analytics script to run every time.
2. Alternatively, you could look into separating the analytics script from the cookie consent logic, ensuring it runs independently.
3. If you're using Google Analytics, you might want to look into their "cookieless" tracking options, which don't require user consent.
For more specific guidance on implementing these changes in your Wasp project, I recommend:
1. Checking the Wasp documentation for any relevant information about customizing components or handling analytics.
2. Reaching out to the Wasp community on Discord (https://discord.gg/rzdnErX) for more tailored assistance.
3. If you're using the OpenSaaS template, you might want to look at its documentation or repository for any specific instructions on customizing components like the cookieConsentBanner.
Remember, when making changes to consent and tracking mechanisms, ensure you're complying with relevant privacy laws and regulations in your jurisdiction.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @NEROX, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
Idk, doesnt track anaytics https://toograded.com/
@NEROX here are our docs on it: https://docs.opensaas.sh/guides/cookie-consent/ . I believe you need to delete appropriate files. As for analytics not working -> hm are they relying on Cookie consents in some way @Vinny (@Wasp) ? Do I remember correctly that Cookie consent is the one that injects google analytics script into webpage? Meaning, if you don't have cookie consent anymore, you should manually add google analytics script to the index.html (probably via
app.head
in main.wasp
.OpenSaaS.sh
Cookie Consent Modal
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.
Yeah, it actually says here that on cookie acceptance we inject GA analytics script: https://docs.opensaas.sh/guides/cookie-consent/ .
SO yeah, if you are dropping cookie consent but want to have GA analytics, you have to add it yourself, the script.
OpenSaaS.sh
Cookie Consent Modal
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.
Will check, this file form cookie
config.ts
, i think is the reponsibleyeah, insertion happens in onAccept callback
you now need to do that manually
probably just copy that code to main.wasp under app.head
The script code, so something like
<script ....
oh yeahh, just adding 2 lines. Solved✅
Edit: ❌But it only tracks the first page, trying to solve that
✅ Solved, now is tracking each page (and tested)
Adding to
App.tsx
:
Adding to main.wasp
:
And creating a usePageTracking.ts
:
Do you think we should add an issue to update the docs with this info in the case they don't want to use the cookie consent modal? Or just let them figure it out themselves
This guy is the God of Analytics: https://www.analyticsmania.com/post/single-page-web-app-with-google-tag-manager/
Julius Fedorovicius
Analytics Mania
Track Single Page Apps with Google Analytics 4 and Google Tag Manager
Learn how to track Single Page App with Google Tag Manager (or Single Page Website), and send that pageview data to Google Analytics.
Thanks, added link to our SEO issue for Wasp to take into condiseration
Hm yeah I tihnk we should!