• Resolved Jan

    (@krugmedien)


    hi,

    thank you for your plugin.

    in your plugin the events fire with the jquery ready event.

    in my case the matomo tracking code is added to a cookie banner, which executes scripts shortly AFTER that.

    that results in the _paq is not defined error.

    it would be great if you could add an option to your plugin which lets user choose between

    $(document).ready(function() { 

    and

    $(window).load(function () {

    i guess that would fix this error.

    thats it, have a great day. 🙂

    Jan

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Killian Santos

    (@killiansantos)

    Hello @krugmedien,

    Thank you for your feedback and suggestion.

    Could you please tell me which solution or plugin you are using for your cookie banner?

    This would help me better understand the issue and possibly test a smoother integration.

    Thanks in advance for your reply and have a great day!

    Best regards,
    Killian

    Thread Starter Jan

    (@krugmedien)

    hi Killian,
    i am using “Real Cookie Banner (Free)“.
    there is a large textarea for opt-in scripts: “Cookies” > “Services (Cookies)” > “Add service” > “Create from scratch” > “Code executed on opt-in“.

    Plugin Author Killian Santos

    (@killiansantos)

    Hi @krugmedien,

    Noted, thank you!

    I have prepared an alpha version for you. Could you please test it on a staging site? Here is the download link: https://drive.google.com/file/d/1UNEWXmYFN8zCMQc-SHWW_MFAMaIcgHwW/view?usp=sharing

    Let me know if it works as expected. If so, I will proceed with implementing and updating the plugin.

    Thank you.
    Killian

    Thread Starter Jan

    (@krugmedien)

    hello Killian,
    thank you very much for your quick reply.
    same error. your matomo event scripts are firing, before the matomo script in the cookie banner.
    (another case to consider: if users choose to not load matomo, the matomo script will never be loaded for those users.)
    this might be a solution:

    function check_paq() {
    if (typeof _paq === "undefined") {
    return;
    }
    clearInterval(paq_checker);
    console.log("loaded");
    // event scripts here
    }
    var paq_checker = setInterval(check_paq, 1000);

    Plugin Author Killian Santos

    (@killiansantos)

    Hello @krugmedien,

    Thank you for your response, and apologies for my slightly delayed reply, I’ve been quite busy these past few days.

    I have prepared a new version for you that includes this logic: https://drive.google.com/file/d/10cyGBVS81D-m9fObs9L_rchCEyoqoM5M/view?usp=sharing

    Could you please test it and let me know if it works better this time?

    Thank you for your help.
    Killian

    Plugin Author Killian Santos

    (@killiansantos)

    Hello @krugmedien,

    You might be a bit busy at the moment. Have you had the time to test the version I sent you?
    Is it working as you expected?

    When you have a few minutes, please feel free to give me some feedback.

    Have a great day!
    Killian

    Plugin Author Killian Santos

    (@killiansantos)

    Hello @krugmedien,

    It’s been a while since I last heard from you. I hope everything is going well on your end.

    I’m closing this conversation for now, but please feel free to reach out again whenever you have some time.

    Best regards,
    Killian

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Uncaught ReferenceError: _paq is not defined’ is closed to new replies.