'Manually trigger/open Piwik consent manager?

Piwik provides js snippets for a consent manager popup and an embedded version for a privacy page.

I want to give the website users the posbiliy to change their consent, e.g. to watch a YouTube video without navigating to the privacy page, right away. Therefore a placeholder is displayed instead of the video.

The easiest way would be to trigger the consent popup manually from that placeholder image by click.

Piwik do not have documented such a functionality.

Does someone know a clever workaround to display the popup again after initially setting consents. By default the popup will only occur again when deleting cookies and local storage in the browser.



Solution 1:[1]

I reduced the html from privacy page to show only the button.

<div id="ppms_cm_privacy_settings" data-editor-centralize="true"
        data-main-container="true" data-root="true">
    <div data-disable-select='true'>
        <button class="btn btn-default" id="ppms_cm_privacy_settings_button">Privacy settings
        </button>
    </div>
</div>

This will raise the privacy policy dialog right at the placeholder.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 CalleKhan