Comments (4)
You can customize the payload of page views, identity calls, and tracking events with custom plugins
For example, if you want all pageView calls to have something specific or keys removed you can use a plugin. Hook into the pageStart
lifecycle event.
import Analytics from 'analytics'
import segmentPlugin from '@analytics/segment'
function myCustomPageDataPlugin(userConfig = {}) {
return {
name: 'my-custom-page-plugin',
config: Object.assign({}, userConfig),
pageStart: ({ payload }) => {
// Alter payload before it reached .page calls
return Object.assign({}, payload, {
addThis: 'hello',
addThat: 'goodbye'
})
}
}
}
/* initialize analytics and load plugins */
const analytics = Analytics({
debug: true,
app: 'yolo',
plugins: [
myCustomPageDataPlugin(),
segmentPlugin({
writeKey: 'xyz'
})
]
})
analytics.page()
from analytics.
Hi @DavidWells thank you for taking the time to reply. I will investigate to see if this will achieve the desired effect. I think I had issues altering the page call to be able to have Page(name, pageData) go through since the Page interface only allows for calling Page (page Data) but let me have a look and see what I can accomplish. Thanks again 👍
from analytics.
Hwy @Carl-Meyer any updates here?
from analytics.
Hi @DavidWells seems like not having the page name param in the sentry preview isn't an issue for us so I didn't end up implementing your solution. Sorry, but thank you for the support.
from analytics.
Related Issues (20)
- Request an analytics integration HOT 1
- Plugin Request: AWS Personalize HOT 1
- @analytics/snowplow not working HOT 1
- Remove user_id as a custom dimension in google-analytics event payload
- Angular warns about using "dlv" – can cause optimization bailouts HOT 2
- Allow URL params for simpleanalytics HOT 2
- Request to upgrade analytics-node to resolve security issue in Axios HOT 2
- Update intercom-client in analytics-plugin-intercom
- Add support for Rudderstack HOT 1
- ga4 support for other protocols HOT 1
- Plugin Request - Server-side Implementation - Google Analytics HOT 3
- Clients throwing error: abort is not a function HOT 6
- Dependency Security: Axios Cross-Site Request Forgery Vulnerability HOT 1
- new Chrome cookie policy warning HOT 1
- OneTrust integration HOT 2
- Google Consent Mode v2 HOT 3
- Google Tag Manager - Consent Mode V2 implementation (Next.js 14)
- Customerio Plugin uses customerio-node v0.5.0
- How to contribute a plugin? HOT 1
- Unloading Plugins based on Path HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics.