jQuery on 'load' fails when Analytics and Piwik are being blocked

149 views Asked by At

As soon as both Piwik and Google Analytics are being blocked e.g. with a browser privacy extension, other custom javascripts fail to execute when the code is wrapped in the jQuery $(window).on('load', {}) event.

We discovered that on our company's website by coincidence. Further debugging showed that the custom scripts work if only one tracker is blocked, but it doensn't matter which one.

The different cases:

  1. Nothing is blocked, rendering is okay

Nothing blocked, no errors

  1. Piwik is blocked, rendering is okay

Piwik blocked, rendering is okay

  1. GA is blocked, rendering is okay

enter image description here

  1. Piwik and GA are blocked, code in $(window).on('load', {}) for calculating panel sizes does not get executed, rendering is not okay.

Piwik and GA blocked, Rendering not okay

This is the custom pseudo javascript code

(function($, viewport) {
    $(document).ready(function() {

        // gets executed
        console.log("hello");

        // does not get executed when both trackers are blocked
        $(window).on('load', function() {
            calculatePanelSizes();
        });

    });
})(jQuery, ResponsiveBootstrapToolkit); 

Do you have any hints on this?

0

There are 0 answers