Hey :wave: I need to integrate Cookie Consent usi...
# support
o
Hey 👋 I need to integrate Cookie Consent using Finsweet solution, a rather simple one. It only needs modifying loaded
<script>
tags with appropriate attributes, like
type="fs-cc"
and
fs-cc-categories="analytics"
. Is there some kind of config / middleware support for this?
ChatGPT gave me this answer, can I trust it (I will test it anyway 😄)?
Copy code
rudderanalytics.ready(function() {
    // Modify the script tag before it gets inserted into the DOM
    rudderanalytics.on("beforeLoad", function(context) {
      if (context.integration.name === "Google Analytics") {
        var scriptElement = context.node;
        if (scriptElement) {
          scriptElement.setAttribute("type", "fs-cc");
        }
      }
    });

    rudderanalytics.load("WRITE_KEY");
q
How was this test? Did it work?
o
No it absolutely didn't
So far, it seems the only way to control what integration to load is to delay call to
RS.load
and finetune what's in there.
k
CC <!subteam^S04QT1G74Q3|@sdk-team>
h
@orange-television-64036 Here is how you can do it: https://www.rudderstack.com/docs/sources/event-streams/sdks/onetrust/javascript/#can-i-integrate-the-rudderstack-[…]k-with-any-other-consent-manager You need to collect the consent first then call rudderanalytics.load() with appropriate configuration. Right now you can only filter device mode destinations with these consents.
o
Yeah that's what I figured - and the feedback I gave @plain-parrot-49913 who contacted me is that it'd be nice to leverage the OneTrust category attribute (or a new, more generic one) to be able to do something like
load({categories: ['marketing', 'ads']})
✅ 1
I mean, we have the categories, let's leverage them
h
We can treat it as new feature request.