代码之家  ›  专栏  ›  技术社区  ›  Obromios

谷歌分析IP匿名破解代码

  •  1
  • Obromios  · 技术社区  · 7 年前

    ga('set', 'anonymizeIp', true);
    

    到谷歌分析跟踪代码,但这阻止了跟踪代码的工作。在控制台中,我得到以下错误:

     (index):363 Uncaught TypeError: ga is not a function
    

    1 回复  |  直到 7 年前
        1
  •  0
  •   Obromios    7 年前

    var ga = document.createElement('script');
    

    (window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    

    GA是一个函数,所以

    ga('set', 'anonymizeIp', true);