|
9 | 9 | <button>Load</button> |
10 | 10 | </form> |
11 | 11 | <p id='status-msg'></p> |
12 | | - |
13 | | - <button id='track-product-viewed' onclick="analytics.track('Product Viewed')"> |
| 12 | + <button id ='unsafe-eval'>Unsafe eval</button> |
| 13 | + <button id='track-product-viewed'> |
14 | 14 | Track: Product Viewed |
15 | 15 | </button> |
16 | | - <button id='track-checkout-started' onclick="analytics.track('Checkout Started')"> |
| 16 | + <button id='track-checkout-started'> |
17 | 17 | Track: Checkout Started |
18 | 18 | </button> |
19 | | - <button id='track-coupon-denied' onclick="analytics.track('Coupon Denied')"> |
| 19 | + <button id='track-coupon-denied'> |
20 | 20 | Track: Coupon Denied |
21 | 21 | </button> |
22 | 22 | <br /> |
23 | | - <button id='page-home' onclick="analytics.page('Home')">Page: Home</button> |
24 | | - <button id='page-about' onclick="analytics.page('About')">Page: About</button> |
25 | | - <button id='page-contact' onclick="analytics.page('Contact')">Page: Contact</button> |
| 23 | + <button id='page-home'>Page: Home</button> |
| 24 | + <button id='page-about'>Page: About</button> |
| 25 | + <button id='page-contact'">Page: Contact</button> |
26 | 26 | <br /> |
27 | | - <button id='identify-fathy' onclick="analytics.identify('fathy')">Identify: fathy</button> |
28 | | - <button id='identify-spongebob' onclick="analytics.identify('spongebob', {'lastname':'squarepants'})"> |
| 27 | + <button id='identify-fathy'>Identify: fathy</button> |
| 28 | + <button id='identify-spongebob'> |
29 | 29 | Identify: spongebob |
30 | 30 | </button> |
31 | | - <button |
32 | | - id='group' |
33 | | - onclick="analytics.group( |
34 | | - 'group name', |
35 | | - { |
36 | | - 'address': { |
37 | | - 'city': 'Vancouver', |
38 | | - 'country': 'Canada', |
39 | | - 'postalCode': 'V6b3E2', |
40 | | - 'state': 'BC', |
41 | | - 'street': '21 Jump St' |
42 | | - }, |
43 | | - 'avatar': 'does not exist', |
44 | | - 'description': 'a fake group', |
45 | | - 'email': 'email-me-not@domain.com', |
46 | | - 'employees': 3, |
47 | | - 'id': 1, |
48 | | - 'industry': 'sw eng', |
49 | | - 'name': 'libweb', |
50 | | - 'phone': '555-pizza', |
51 | | - 'website': 'www.google.com', |
52 | | - 'plan': 'business' |
53 | | - }, |
54 | | - { |
55 | | - 'integrations': { |
56 | | - 'All': true |
57 | | - } |
58 | | - }, function() { console.log('group callback triggered')})" |
59 | | - > |
| 31 | + <button id='group'> |
60 | 32 | Group |
61 | 33 | </button> |
62 | 34 |
|
63 | | - <button |
64 | | - id='alias' |
65 | | - onclick="analytics.alias('userId', 'previous id', { |
66 | | - 'integrations': { 'All': true } |
67 | | - }, function(){ console.log('alias callback triggered')})" |
68 | | - > |
| 35 | + <button id='alias'> |
69 | 36 | Alias |
70 | 37 | </button> |
71 | 38 |
|
72 | | - <button id='reset' onclick="analytics.reset()">Reset</button> |
| 39 | + <button id='reset'>Reset</button> |
73 | 40 | <br /> |
74 | 41 |
|
75 | | - <script> |
| 42 | + <script nonce="someNonce"> |
76 | 43 | const { searchParams } = new URL(document.location); |
77 | 44 | const writeKey = searchParams.get("writeKey"); |
78 | 45 | const cdnHost = searchParams.get("cdnHost") || 'cdn.segment.com'; |
|
160 | 127 | status("ajs not loaded, enter a write key"); |
161 | 128 | } |
162 | 129 | </script> |
| 130 | + <script src='index.js' nonce="someNonce"></script> |
163 | 131 | </body> |
164 | 132 | </html> |
0 commit comments