Jquery in the footer
-
Hello,
We move all jquery to the footer but when using this plugin there is no (obvious) way within the plugin settings of forcing jquery to load in the footer. This means we get javascript errors for the default settings which includes this block:
<script type="text/javascript"> (function($){ $(window).load(function() { //Track Downloads $('a').filter(function() { return this.href.match(/.*\.(zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*)(\?.*)?$/); }).click(function(e) { ga('send','event', 'download', 'click', this.href); }); //Track Mailto $('a[href^="mailto"]').click(function(e) { ga('send','event', 'email', 'send', this.href); }); //Track Outbound Links $('a[href^="http"]').filter(function() { if (!this.href.match(/.*\.(zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*)(\?.*)?$/)){ if (this.href.indexOf('brightwater.com') == -1) return this.href; } }).click(function(e) { ga('send','event', 'outbound', 'click', this.href); }); }); })(jQuery); </script>
before jquery has been loaded. I might have missed something, which is quite possible, however if you are not already doing so is there any way you can update the plugin to load this using wp_enqueue_script and requiring jquery?
Thanks
https://www.ads-software.com/plugins/google-analytics-dashboard-for-wp/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Jquery in the footer’ is closed to new replies.