MCPcopy Create free account
hub / github.com/DavidWells/analytics / analyticPlugin

Function analyticPlugin

packages/plugin-template/src/browser.js:10–38  ·  view source on GitHub ↗
(userConfig)

Source from the content-addressed store, hash-verified

8
9/* Export the integration */
10export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected