2015-08-26 68 views
1

您好我正在使用uBlock起源,它似乎阻止此代碼我用於股利。我正在使用GA實驗來改變用戶變體的div風格。AdBlock阻止我的jquery

<script> 
    if ($(window).width() > 768 && $('.book-now').length) { 
     // Ask Google Analytics which variation to show the user. 
     var chosenVariation = cxApi.chooseVariation(); 

     // Define JavaScript for each page variation of this experiment. 
     var pageVariations = [ 
      function() { 
       $('.menu').addClass('menu-widget'); 
      }, 
      function() { 
       $('.menu').addClass('menu-custom'); 
      } 
     ]; 

     // Wait for the DOM to load, then execute the view for the chosen variation. 
     $(document).ready(
      // Execute the chosen view 
      pageVariations[chosenVariation] 
     ); 
    } 
</script> 



<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> 
<script> 

    (function (i, s, o, g, r, a, m) { 
     i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function() { 
      (i[r].q = i[r].q || []).push(arguments) 
     }, i[r].l = 1 * new Date(); a = s.createElement(o), 
      m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) 
    })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); 

    ga('create', 'UA-46138466-1', 'thehoxton.com'); 
    ga('send', 'pageview'); 
    ga('require', 'ecommerce', 'ecommerce.js'); 



</script> 

是否的AdBlock/uBlock塊谷歌分析代碼或者是有什麼與我的JavaScript,允許其通過插件孤單被阻止?

回答

0

ABP確實阻止GA。不確定關於uBlock。

有一個模擬解決ABP here