Jump to content

joshua

Members
  • Posts

    89
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by joshua

  1. On 6/3/2023 at 8:26 AM, Ellyot_Chase said:

    On the page in the <body> i've put the example script

    
    <script  data-type="text/javascript" data-category="functional" class="require-consent">console.log("This script only runs after giving consent to functional cookies");</script>

    and in the console the message shows.

    Then: when i give consent- it shows up again in the console!

     

    Hi @Ellyot_Chase,

    in the above example you posted there is no type defined on the script element.
    See the original example here:

    <script type="text/plain" data-type="text/javascript" data-category="functional" class="require-consent">console.log("This script only runs after giving consent to functional cookies");</script>

    Without the `type="text/plain"` the browser immediately executes the script, PrivacyWire has no chance to stop this behaviour.
    When you add the type, the script should only be loaded after the user has given consent.

     

    • Like 1
  2. 1 hour ago, update AG said:

    Somehow the Scripts aren't loaded (the banner doesn't appear) when we access a url created with URL-Hooks https://processwire.com/blog/posts/pw-3.0.173/#introducing-url-path-hooks?

    That's an interesting finding. PrivacyWire hooks into the page->render method for the rendering:

      $this->wire('page')->addHookBefore('render', $this, 'initiatePrivacyWire');

    Is this still called when accessing a URL created with URL-Hooks? If not, what would be an alternative point to hook=

  3. Sorry for my late response in general.
    I haven't used ProcessWire ( and therefore also PrivacyWire) in new business projects in the last time but was quiet busy with work.
     

    On 3/6/2022 at 10:15 AM, ceberlin said:

    Right now, I am using CSS to hide .privacywire and its wrapper on those.

    I think that actually is the easiest way right now.

     

    On 5/29/2022 at 12:37 PM, fruid said:

    Is PrivacyWire GDPR compliant? (General Data Protection Regulation in the EU)

    In general yes. But it depends on how you implement PrivacyWire and the 3rd-party scripts!

     

    On 5/29/2022 at 12:37 PM, fruid said:

    So any chance I can accomplish this with PrivacyWire? 

    Yes, this is possible. See this forum thread for examples.

    On 6/16/2022 at 9:27 AM, fruid said:

    would be great if you could add custom cookie categories

    Feel free to fork, add the feature and start an PR.

    • Like 2
  4. 3 hours ago, eelkenet said:

    However, due to the way PrivacyWire has been built, it looks at the $users language BEFORE any of this takes place (in its ready() function).

    That's correct, currently PrivacyWire loads itself in the module ready() method.

    I played around with some settings to load PrivacyWire later. You can find the feature in this branch:
    https://github.com/webworkerJoshua/privacywire/tree/feature-initiate-privacywire-laster
    In this version PrivacyWire initiates itself before Page::render:

    $this->addHookBefore('Page::render', $this, 'initiatePrivacyWire');

    Could you try this version and confirm, that it's working the way you wanted / expected? After that I will do some more testing before merging into the main branch just to be sure that there are no side effects ?

    Thanks!
     

    • Like 1
    • Thanks 1
  5. Is your ProcessWire instance installed in the root web directory or somewhere else?

    The only noticible change I find in your code examle is the directory within the script tag:

    <script nomodule type='text/javascript' src='.../site/modules/PrivacyWire/js/PrivacyWire_legacy.js'>

    Usually the src attribute starts directly with '/site/' instead of '.../site/'

    <style>.privacywire{position:fixed;bottom:-250%;left:0;right:0;box-shadow:0 -1px 3px rgba(0,0,0,.3);opacity:0;background:#fff;z-index:1;padding:1rem;transition:bottom .3s ease-in,opacity .3s ease}.show-banner .privacywire-banner,.show-message .privacywire-message,.show-options .privacywire-options{bottom:0;opacity:1}.privacywire-header{font-weight:700}.privacywire-ask-consent-blueprint,.privacywire button[hidden],[data-ask-consent-rendered="1"]{display:none}</style>
    <script>var PrivacyWireSettings={"version":1,"dnt":"0","customFunction":"","messageTimeout":1500,"consentByClass":"1","cookieGroups":{"necessary":"Necessary","functional":"Functional","statistics":"Statistics","marketing":"Marketing","external_media":"External Media"}};</script>
    <script type='module' src='/site/modules/Privacywire/js/PrivacyWire.js'></script>
    <script nomodule type='text/javascript' src='/site/modules/Privacywire/js/ie_polyfill.js'></script>
    <script nomodule type='text/javascript' src='/site/modules/Privacywire/js/PrivacyWire_legacy.js'></script>

     

    • Like 1
  6. 8 minutes ago, ceberlin said:

    <script type=text/plain" data-type="text/javascript" data-category="external_media" class="require-consent">

    In this example the starting quote at the type attribute is missing:

    <script type="text/plain" data-type="text/javascript" data-category="external_media" class="require-consent">...</script>

    In your example:

    grafik.thumb.png.46242ea432b39cd9e48c40b9d1d4e4f1.png

     

    Does it work with the quotation mark?

    • Like 1
  7. On 3/23/2021 at 10:28 AM, Matze said:

    Hi. Is it possible to make it like a window or modal centered in the middle of the page and the background overlayed with a half transparent color?
    I tried to customize it via CSS but didn’t manage it. Maybe there is an easier solution for this?

    You mean something like the screenshot attached?

    That's possible with some CSS (this is just an example, how one could do this)

    
        .show-banner > .privacywire-page-wrapper,
        .show-options > .privacywire-page-wrapper,
        .show-message > .privacywire-page-wrapper {
            position: fixed;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(5px);
            display: flex;
            justify-content: center;
            align-items: center;
        }
    
        .privacywire {
            display: none;
        }
    
        .show-banner .privacywire.privacywire-banner,
        .show-options .privacywire.privacywire-options,
        .show-message .privacywire.privacywire-message {
            display: block;
            position: relative;
            left: auto;
            right: auto;
            bottom: auto;
            max-width: 450px;
        }

     

    Bildschirmfoto 2021-04-05 um 14.58.19.png

    • Like 2
    • Thanks 1
  8. On 3/18/2021 at 1:57 PM, fruid said:

    I did this. If I leave the src tag empty, nothing is loaded. If I accept the marketing cookies, nothing is loaded either ?
    I'm on local BTW, not sure if that's relevant

    You can ommit the src attribute also. In my test case it works that way.
    I use it a lot in combination with vimeo video and used the implementation as in this video

  9. Right now there is no "clear cookie" function. You could add an custom js function, which gets triggered after saving the consent and insert the function name in the module config option.

    grafik.png.3b13bd981f7e2d76d228cf879f4b33a8.png

    One easy way to not use google analytics afterwards, would be a simple reload:

    var reloadAfterConsent = function() {
      window.location.reload();
    };

    After the reload, the google script will not be loaded again, but the cookies will remain.

    To also delete existing cookies, some extra work is needed as PrivacyWire don't know, what cookies got set by which script and you probably don't want to delete all cookies.
    You could write a function to check for current consent state and delete cookies, if no consent to a specific category is given.
    Here is a very rough (and not tested in real life) idea, how you could do something like this:

    function eraseCookie(name) {   
        document.cookie = name+'=; expires=Thu, 01 Jan 1970 00:00:00 UTC;';  
    }
    
    var removeGoogleCookies = function() {
      if(window.PrivacyWire.userConsent.cookieGroups.statistics !== true) {
        eraseCookie("_ga");
        eraseCookie("_gid");
    	// or whatever your cookie names are
      }
    };
    
    

    And then add removeGoogleCookies to the "Trigger a custom js function" config option. This script is written with the new logic from the ES6 branch, should also work in earlier versions with different naming though.

     

    • Like 1
  10. @LAPS With this new version, there are even more customizations available. Have a look into the comments in PrivacyWire.module.

    This example code does the same as the one from my post from last Friday, but with the new syntax of the new version:

    <html>
      <head>
        <!-- your head content -->
        <?php
        $privacywire = $modules->get("PrivacyWire");
        // load the css files
        echo $procache->link([
            $config->urls->template . "path/to/your/stylesheet.css",
            $privacywire->getPrivacyWireStyles()->url
        ]);
        
        // load the inline script
        echo $privacywire->renderPrivacyWireConfigAsInlineJs();
        ?>
      </head>
      <body>
        <!-- your body content -->
        <!-- your body content -->
        <!-- your body content -->
        <?php
        // render the required DOM elements
        echo $privacywire->bodyContent;
        
        // render the JavaScript files
        echo $procache->script([
        $config->urls->template . "path/to/your/scripts.js",
        $privacywire->getPrivacyWireCore()->url
    ]);
        ?>
      </body>
    </html>

     

    • Like 3
  11. Hey everyone,

    I did a lot of refactoring of PrivacyWire this weekend - both for the backend and frontend.
    The Javascript core of PrivacyWire is nearly completely rewritten in ES6. This results in much better readability and of course extensibility. For examle, as asked by @Torsten Baldes, one can now manually trigger to refresh the element detection of PrivacyWire by simple running the following function afterwards:

    window.PrivacyWire.refresh();

    You'll find a brief overview of the updates here: https://github.com/blaueQuelle/privacywire/blob/es6/CHANGELOG.md#101b-beta

    Right now this update is in an separate branch at github: https://github.com/blaueQuelle/privacywire/tree/es6
    I would be happy if some of you could test this version in your dev environment.
    If you haven't used any hooks or modifications, it should just run without any changes.

    I'm looking forward to your feedback! ?

    Best,
    Joshua

     

    • Like 4
    • Thanks 2
  12. Hi everyone,

    did I understood it correctly, that you want to to include the JS provided by PrivacyWire in one combined file with your other JS files via ProCache?
    And the same with the CSS styles?
    This actually requires some steps, as PrivacyWire needs the inline script (to pass the backend settings to the frontend), the body content (to have the DOM elements of the banner) and the JS file (to provide the functionality).

    With the newest PrivacyWire version (0.4.4) you can do it that way:

    Check the "Render Banner and Header Content Manually" in the PrivacyWire config options:
    grafik.png.153d046c2033e3927801d2f356918c8d.png

    Add the required elements as followed:

    <html>
      <head>
        <!-- your head content -->
        <?php
        // load the css files
        echo $procache->link([
            $config->urls->template . "path/to/your/stylesheet.css",
            $modules->get("PrivacyWire")->getPathToCssFile()
        ]);
        
        // load the inline script -> needs to be before the other scripts
        echo $modules->get("PrivacyWire")->getInlineJavaScriptTag();
        ?>
      </head>
      <body>
        <!-- your body content -->
        <?php
        // render the required DOM elements
        echo $modules->get("PrivacyWire")->renderBodyContent();
        
        // render the JavaScript files
        echo $procache->script([
        $config->urls->template . "path/to/your/scripts.js",
        $modules->get("PrivacyWire")->getJsFile()
    ]);
        ?>
      </body>
    </html>

     

    • Like 1
×
×
  • Create New...