1 | <!DOCTYPE html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta charset="UTF-8"> |
---|
5 | <title>DojoX Google Analytics Test</title> |
---|
6 | |
---|
7 | <style type="text/css"> |
---|
8 | @import "../../../dojo/resources/dojo.css"; |
---|
9 | @import "../../../dijit/tests/css/dijitTests.css"; |
---|
10 | </style> |
---|
11 | |
---|
12 | <!-- required: dojo.js --> |
---|
13 | <script src="../../../dojo/dojo.js" |
---|
14 | data-dojo-config="parseOnLoad: true, isDebug: true, async:true, urchin: 'UA-123456-7'"> |
---|
15 | </script> |
---|
16 | |
---|
17 | <!-- do not use: only for testing alternate themes --> |
---|
18 | <script src="../../../dijit/tests/_testCommon.js"></script> |
---|
19 | |
---|
20 | <script> |
---|
21 | require([ |
---|
22 | "dojo/ready", |
---|
23 | "dojo/parser", |
---|
24 | "dojox/analytics", |
---|
25 | "dojox/analytics/Urchin", |
---|
26 | "dojo/on", |
---|
27 | "dojo/dom-attr", |
---|
28 | "dojo/dom" |
---|
29 | ], function(ready, analytics, Urchin, on, domAttr, dom){ |
---|
30 | ready(function(){ |
---|
31 | // NOTE: this method does not permit you to do Ajax-style page tracking |
---|
32 | // you will need to manually create a tracker programatically, and save |
---|
33 | // a reference. This is done to avoid taking in _Widget overhead for |
---|
34 | // this simple class. |
---|
35 | console.log("dom ready, now loading Urchin in background"); |
---|
36 | console.log("passed:", inmarkup.acct == "UA-12345-6785"); |
---|
37 | console.log("passed:", fromconfig.acct == "UA-123456-7"); |
---|
38 | }); |
---|
39 | }); |
---|
40 | </script> |
---|
41 | </head> |
---|
42 | <body> |
---|
43 | <h1>Simple Lazy loading of Google Analytics Code</h1> |
---|
44 | <div data-dojo-id="fromconfig" data-dojo-type="dojox/analytics/Urchin" data-dojo-props="acct:'UA-123456-7'"></div> |
---|
45 | <div data-dojo-id="inmarkup" dojoType="dojox/analytics/Urchin" data-dojo-props="acct:'acctUA-12345-6785'"></div> |
---|
46 | </body> |
---|
47 | </html> |
---|