(userConfig)
| 8 | |
| 9 | /* Export the integration */ |
| 10 | export default function analyticPlugin(userConfig) { |
| 11 | // Allow for userland overides of base methods |
| 12 | return { |
| 13 | name: 'plugin-name', |
| 14 | config: { |
| 15 | ...config, |
| 16 | ...userConfig |
| 17 | }, |
| 18 | initialize: ({ config }) => { |
| 19 | console.log('Load browser scripts!') |
| 20 | }, |
| 21 | /* page view */ |
| 22 | page: ({ payload, config }) => { |
| 23 | console.log('Run pageview in browser') |
| 24 | }, |
| 25 | /* track event */ |
| 26 | track: ({ payload, config }) => { |
| 27 | console.log('track event in browser') |
| 28 | }, |
| 29 | /* identify user */ |
| 30 | identify: ({ payload }) => { |
| 31 | console.log('identify user in browser') |
| 32 | }, |
| 33 | /* Verify script loaded */ |
| 34 | loaded: function() { |
| 35 | return !!window.myWindowGlobal |
| 36 | } |
| 37 | } |
| 38 | } |
nothing calls this directly
no outgoing calls
no test coverage detected