Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58b1849
commit 3671ab3
Showing
2 changed files
with
41 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,46 @@ | ||
import Analytics from 'analytics' | ||
import googleAnalytics from '@analytics/google-analytics' | ||
|
||
const validationPlugin = { | ||
NAMESPACE: 'id-plugin-start', | ||
identifyStart: ({ payload, abort }) => { | ||
return abort('Identify traits is the same as previous identify'); | ||
} | ||
} | ||
|
||
const abortQueueTests = [ | ||
validationPlugin, | ||
{ | ||
NAMESPACE: 'page-plugin-start', | ||
pageStart: ({ abort }) => { | ||
return abort('stop all other page calls') | ||
}, | ||
}, | ||
{ | ||
NAMESPACE: 'page-plugin', | ||
page: ({ payload, abort }) => { | ||
console.log('abort', abort) | ||
console.log('Run page') | ||
} | ||
} | ||
] | ||
|
||
const GaPlugin = [ | ||
googleAnalytics({ | ||
measurementIds: ['G-RL2P3ZC6B2'], | ||
// gtagConfig: { | ||
// send_page_view: true, | ||
// } | ||
// debug: true | ||
}), | ||
] | ||
|
||
/* initialize analytics and load plugins */ | ||
const analytics = Analytics({ | ||
debug: true, | ||
app: 'yolo', | ||
version: '1.2.0', | ||
plugins: [ | ||
googleAnalytics({ | ||
measurementIds: ['G-RL2P3ZC6B2'], | ||
// gtagConfig: { | ||
// send_page_view: true, | ||
// } | ||
// debug: true | ||
}), | ||
] | ||
plugins: GaPlugin | ||
}) | ||
|
||
export default analytics |