Git Product home page Git Product logo

Comments (14)

jonaseberle avatar jonaseberle commented on June 26, 2024 1

I see the problem now. It is in your configuration.

You defined the Tracking Object fe_typo_user in group mandatory, but your settings do not define plugin.tx_cookieman.settings.trackingObjects.fe_typo_user.show.

from extension-cookieman.

blueamerican avatar blueamerican commented on June 26, 2024

error

from extension-cookieman.

jonaseberle avatar jonaseberle commented on June 26, 2024

Hi Markus,

I reckon that you have not defined any tracking objects.

Does this happen in a default install after you have included the static TypoScript templates (including the examples)?

Maybe you want to post your Tracking Object TypoScript.

from extension-cookieman.

blueamerican avatar blueamerican commented on June 26, 2024
plugin.tx_cookieman.settings.trackingObjects {
    Matomo {
        # inline scripts would break Content-Security-Policy: script-src
        # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src
        inject (
            <script data-what="Matomo" src="/fileadmin/js/cookieman-inject.js"></script>
        )

        show {
            _pk_id {
                duration = 13
                durationUnit = months
                type = cookie_http+html
                provider = Matomo
                #Pattern searches for all cookies that are named like _pk_id.{website ID}.{user hash}
                htmlCookieRemovalPattern = ^_pk_id\.\d+\.[a-fA-F0-9]+$
            }

            _pk_ref {
                duration = 6
                durationUnit = months
                type = cookie_http+html
                provider = Matomo
                htmlCookieRemovalPattern = ^_pk_ref\.\d+\.[a-fA-F0-9]+$
            }

            _pk_ses {
                duration = 30
                durationUnit = minutes
                type = cookie_http+html
                provider = Matomo
                htmlCookieRemovalPattern = ^_pk_ses\.\d+\.[a-fA-F0-9]+$
            }

            _pk_cvar {
                duration = 30
                durationUnit = minutes
                type = cookie_http+html
                provider = Matomo
                htmlCookieRemovalPattern = ^_pk_cvar\.\d+\.[a-fA-F0-9]+$
            }

            _pk_hsr {
                duration = 30
                durationUnit = minutes
                type = cookie_http+html
                provider = Matomo
                htmlCookieRemovalPattern = ^_pk_hsr\.\d+\.[a-fA-F0-9]+$
            }
        }
    }
}


plugin.tx_cookieman {
    # see documentation: https://github.com/dmind-gmbh/extension-cookieman
    settings {
        groups {
            # extend group (already configured in the base template)
            mandatory {
                trackingObjects {
                    10 = fe_typo_user
                }
            }

            # a new group
            marketing {
                trackingObjects {
                    0 = Matomo
                    #10 = GoogleAnalytics
                    #20 = GoogleTagManager
                    #30 = Bing
                    #40 = FacebookPixel
                }

                respectDnt = 1
                showDntMessage = 1
            }
        }
    }
}

from extension-cookieman.

blueamerican avatar blueamerican commented on June 26, 2024

my cookieman-inject.js:

console.log('cookieman: I would inject ' + document.currentScript.dataset.what + ' now...')
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
    var u = "//stats.mydomain.de/";
    _paq.push(['setTrackerUrl', u + 'piwik.php']);
    _paq.push(['setSiteId', '2']);
    var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
    g.type = 'text/javascript';
    g.async = true;
    g.defer = true;
    g.src = u + 'piwik.js';
    s.parentNode.insertBefore(g, s);
})();

from extension-cookieman.

jonaseberle avatar jonaseberle commented on June 26, 2024

Can you confirm with the Template Analyzer that your TypoScript setup is actually loaded?

And is your TypoScript setup output into HTML in data-cookieman-settings="..."?

from extension-cookieman.

blueamerican avatar blueamerican commented on June 26, 2024

the typoscript is loaded.

The setup:

<div id="cookieman-modal"
     data-cookieman-showonce="1"
     data-cookieman-settings="{&quot;groups&quot;:{&quot;mandatory&quot;:{&quot;preselected&quot;:&quot;1&quot;,&quot;disabled&quot;:&quot;1&quot;,&quot;trackingObjects&quot;:[&quot;CookieConsent&quot;,&quot;fe_typo_user&quot;]},&quot;marketing&quot;:{&quot;respectDnt&quot;:&quot;1&quot;,&quot;showDntMessage&quot;:&quot;1&quot;,&quot;trackingObjects&quot;:[&quot;Matomo&quot;]}},&quot;trackingObjects&quot;:{&quot;CookieConsent&quot;:{&quot;show&quot;:{&quot;CookieConsent&quot;:{&quot;duration&quot;:&quot;1&quot;,&quot;durationUnit&quot;:&quot;year&quot;,&quot;type&quot;:&quot;cookie_http+html&quot;,&quot;provider&quot;:&quot;Website&quot;}}},&quot;Matomo&quot;:{&quot;inject&quot;:&quot;            \u003Cscript data-what=\&quot;Matomo\&quot; src=\&quot;\/fileadmin\/js\/cookieman-inject.js\&quot;\u003E\u003C\/script\u003E&quot;,&quot;show&quot;:{&quot;_pk_id&quot;:{&quot;duration&quot;:&quot;13&quot;,&quot;durationUnit&quot;:&quot;months&quot;,&quot;type&quot;:&quot;cookie_http+html&quot;,&quot;provider&quot;:&quot;Matomo&quot;,&quot;htmlCookieRemovalPattern&quot;:&quot;^_pk_id\\.\\d+\\.[a-fA-F0-9]+$&quot;},&quot;_pk_ref&quot;:{&quot;duration&quot;:&quot;6&quot;,&quot;durationUnit&quot;:&quot;months&quot;,&quot;type&quot;:&quot;cookie_http+html&quot;,&quot;provider&quot;:&quot;Matomo&quot;,&quot;htmlCookieRemovalPattern&quot;:&quot;^_pk_ref\\.\\d+\\.[a-fA-F0-9]+$&quot;},&quot;_pk_ses&quot;:{&quot;duration&quot;:&quot;30&quot;,&quot;durationUnit&quot;:&quot;minutes&quot;,&quot;type&quot;:&quot;cookie_http+html&quot;,&quot;provider&quot;:&quot;Matomo&quot;,&quot;htmlCookieRemovalPattern&quot;:&quot;^_pk_ses\\.\\d+\\.[a-fA-F0-9]+$&quot;},&quot;_pk_cvar&quot;:{&quot;duration&quot;:&quot;30&quot;,&quot;durationUnit&quot;:&quot;minutes&quot;,&quot;type&quot;:&quot;cookie_http+html&quot;,&quot;provider&quot;:&quot;Matomo&quot;,&quot;htmlCookieRemovalPattern&quot;:&quot;^_pk_cvar\\.\\d+\\.[a-fA-F0-9]+$&quot;},&quot;_pk_hsr&quot;:{&quot;duration&quot;:&quot;30&quot;,&quot;durationUnit&quot;:&quot;minutes&quot;,&quot;type&quot;:&quot;cookie_http+html&quot;,&quot;provider&quot;:&quot;Matomo&quot;,&quot;htmlCookieRemovalPattern&quot;:&quot;^_pk_hsr\\.\\d+\\.[a-fA-F0-9]+$&quot;}}}}}"
     class="modal fade" tabindex="-1" role="dialog"
>

from extension-cookieman.

blueamerican avatar blueamerican commented on June 26, 2024

in the root ts template i include the static template "cookieman"
in the setup section:
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/Resources/Typoscript/ext_cookieman.typoscript">

is there a problem with the order of the ts?

from extension-cookieman.

blueamerican avatar blueamerican commented on June 26, 2024

or is this the error, see empty space:

error1

from extension-cookieman.

blueamerican avatar blueamerican commented on June 26, 2024

i removed the empty space:

Matomo":{"inject":"\u003Cscript data-what="Matomo"

what is:
\u003Cscript
?

from extension-cookieman.

jonaseberle avatar jonaseberle commented on June 26, 2024

Empty space is just empty string. It looks like good JSON to me.
\003C is HTML encoded JSON. It's ok, it's the same here: https://cookieman.d-mind.de/theme-bootstrap4-modal

Can you please try with the default static TypoScript, just included in the site template?

image

We run the exact same configuration (TYPO3 9.5.20, cookieman 2.5.1) on https://cookieman.d-mind.de/, too

from extension-cookieman.

blueamerican avatar blueamerican commented on June 26, 2024

with the static template it works

btw: i know another user who has exactly the same problem

from extension-cookieman.

jonaseberle avatar jonaseberle commented on June 26, 2024

We can try to confirm that the settings are correctly parsed in JavaScript.
Could you enter JSON.parse(document.querySelector('[data-cookieman-settings]').dataset.cookiemanSettings) in a JavaScript console?

It should return a JavaScript object.

image

from extension-cookieman.

jonaseberle avatar jonaseberle commented on June 26, 2024

You're welcome.

I am sure you can solve that yourself.

from extension-cookieman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.