Issue using Google Analytics with Require.js

后端 未结 5 1348
说谎
说谎 2021-02-04 16:07

I\'m using require.js (http://requirejs.org/) for a number of functions on my site and so far it seems to be working well. I\'ve run into an issue when trying to include Google

5条回答
  •  悲哀的现实
    2021-02-04 16:38

    Here we go:

    define([ 'http://www.google-analytics.com/ga.js' ], function ( ga ) {
        ga = { q: [['create', 'UA-18710277-1', 'jspm.io'], ['send', 'pageview']], l: Date.now() };
    });
    

    That's the module I am currently using, hat tip to @user2305274

提交回复
热议问题