Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA trackingId -> measurementIds #352

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

![npm](https://img.shields.io/npm/dm/analytics?style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/analytics?style=flat-square) ![GitHub](https://img.shields.io/github/license/davidwells/analytics?style=flat-square)

A lightweight analytics abstraction library for tracking page views, custom events, & identify visitors.
A lightweight analytics abstraction library for tracking page views, custom events, & identify visitors.

Designed to work with any [third-party analytics tool](https://getanalytics.io/plugins/) or your own backend.

Expand Down Expand Up @@ -109,7 +109,7 @@ const analytics = Analytics({
version: 100,
plugins: [
googleAnalytics({
trackingId: 'UA-121991291',
measurementIds: 'UA-121991291',
}),
customerIo({
siteId: '123-xyz'
Expand Down Expand Up @@ -150,7 +150,7 @@ analytics.identify('user-id-xyz', {
version: 100,
plugins: [
googleAnalytics({
trackingId: 'UA-121991291',
measurementIds: 'UA-121991291',
}),
customerIo({
siteId: '123-xyz'
Expand Down Expand Up @@ -592,7 +592,7 @@ analytics.storage.removeItem('storage_key')

### analytics.plugins

Async Management methods for plugins.
Async Management methods for plugins.

This is also where [custom methods](https://bit.ly/329vFXy) are loaded into the instance.

Expand Down Expand Up @@ -903,7 +903,7 @@ const analytics = Analytics({
// include myPlugin
myPlugin(),
customerIoPlugin({
trackingId: '1234'
measurementIds: '1234'
})
...otherPlugins
]
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/src/utils/analytics/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Analytics from 'analytics'
import googleAnalytics from '@analytics/google-analytics'

const customGA = googleAnalytics({
trackingId: process.env.REACT_APP_GOOGLE_ANALYTICS_ID,
measurementIds: process.env.REACT_APP_GOOGLE_ANALYTICS_ID,
enabled: true
})

Expand Down
2 changes: 1 addition & 1 deletion examples/demo/src/utils/analytics/disabled-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Analytics from 'analytics'
import googleAnalytics from '@analytics/google-analytics'

const customGA = googleAnalytics({
trackingId: process.env.REACT_APP_GOOGLE_ANALYTICS_ID,
measurementIds: process.env.REACT_APP_GOOGLE_ANALYTICS_ID,
})

/* initialize analytics and load plugins */
Expand Down
4 changes: 2 additions & 2 deletions examples/demo/src/utils/analytics/example-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import exampleProviderPlugin from './plugins/provider-example'

const googleAnalyticsInstanceTwo = {
...googleAnalytics({
trackingId: 'UA-126647663-6',
measurementIds: 'UA-126647663-6',
instanceName: 'two'
}),
...{
Expand Down Expand Up @@ -34,7 +34,7 @@ const analytics = Analytics({
settingOne: 'xyz'
}),
googleAnalytics({
trackingId: process.env.REACT_APP_GOOGLE_ANALYTICS_ID,
measurementIds: process.env.REACT_APP_GOOGLE_ANALYTICS_ID,
// Custom dimensions mapping example
customDimensions: {
baz: 'dimension1',
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/src/utils/analytics/example-3.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const analytics = Analytics({
}),
*/
googleAnalytics({
trackingId: process.env.REACT_APP_GOOGLE_ANALYTICS_ID,
measurementIds: process.env.REACT_APP_GOOGLE_ANALYTICS_ID,
}),
reduxPlugin,
/*{
Expand Down
2 changes: 1 addition & 1 deletion examples/preact/src/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const analytics = Analytics({
debug: true,
plugins: [
googleAnalytics({
trackingId: 'UA-126647663-2',
measurementIds: 'UA-126647663-2',
}),
]
})
Expand Down
2 changes: 1 addition & 1 deletion examples/using-perfumejs/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const analytics = Analytics({
// Custom plugins to now send perf data to
customAnalyticsPlugin,
googleAnalytics({
trackingId: 'UA-126647663-7'
measurementIds: 'UA-126647663-7'
}),
perfumePlugin({
category: 'perf',
Expand Down
2 changes: 1 addition & 1 deletion examples/vanilla-html/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
version: 100,
plugins: [
analyticsGa({
trackingId: 'UA-126647663-3'
measurementIds: 'UA-126647663-3'
})
// ... add other plugins
]
Expand Down
2 changes: 1 addition & 1 deletion examples/vanilla-html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
plugins: [
// attach google analytics plugin
analyticsGa.default({
trackingId: 'UA-126647663-3'
measurementIds: 'UA-126647663-3'
})
// ... add any other third party analytics plugins
]
Expand Down
2 changes: 1 addition & 1 deletion examples/vue/src/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const analytics = Analytics({
debug: true,
plugins: [
googleAnalytics({
trackingId: 'UA-126647663-5',
measurementIds: 'UA-126647663-5',
autoTrack: true,
}),
]
Expand Down
10 changes: 5 additions & 5 deletions packages/analytics-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![npm](https://img.shields.io/npm/dm/analytics?style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/analytics?style=flat-square) ![GitHub](https://img.shields.io/github/license/davidwells/analytics?style=flat-square)

A lightweight analytics abstraction library for tracking page views, custom events, & identify visitors.
A lightweight analytics abstraction library for tracking page views, custom events, & identify visitors.

Designed to work with any [third-party analytics tool](https://getanalytics.io/plugins/) or your own backend.

Expand Down Expand Up @@ -107,7 +107,7 @@ const analytics = Analytics({
version: 100,
plugins: [
googleAnalytics({
trackingId: 'UA-121991291',
measurementIds: 'UA-121991291',
}),
customerIo({
siteId: '123-xyz'
Expand Down Expand Up @@ -148,7 +148,7 @@ analytics.identify('user-id-xyz', {
version: 100,
plugins: [
googleAnalytics({
trackingId: 'UA-121991291',
measurementIds: 'UA-121991291',
}),
customerIo({
siteId: '123-xyz'
Expand Down Expand Up @@ -590,7 +590,7 @@ analytics.storage.removeItem('storage_key')

### analytics.plugins

Async Management methods for plugins.
Async Management methods for plugins.

This is also where [custom methods](https://bit.ly/329vFXy) are loaded into the instance.

Expand Down Expand Up @@ -901,7 +901,7 @@ const analytics = Analytics({
// include myPlugin
myPlugin(),
customerIoPlugin({
trackingId: '1234'
measurementIds: '1234'
})
...otherPlugins
]
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-plugin-event-validation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const analytics = Analytics({
plugins: [
customValidationPlugin,
googleAnalytics({
trackingId: 'UA-121991123',
measurementIds: 'UA-121991123',
})
]
})
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-plugin-google-analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const analytics = Analytics({
}),
/* Load Google Analytics v3 */
googleAnalyticsV3Plugin({
trackingId: 'UA-11111111-2',
measurementIds: 'UA-11111111-2',
}),
],
})
Expand Down
4 changes: 2 additions & 2 deletions packages/analytics-plugin-perfumejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const analytics = Analytics({
plugins: [
// Attach Google analytics
googleAnalytics({
trackingId: 'UA-12341131-6',
measurementIds: 'UA-12341131-6',
instanceName: 'two'
})
// Attach Hubspot analytics
Expand Down Expand Up @@ -224,7 +224,7 @@ const analytics = Analytics({
plugins: [
// Attach Google analytics
googleAnalytics({
trackingId: 'UA-12341131-6',
measurementIds: 'UA-12341131-6',
instanceName: 'two'
})
// Attach Hubspot analytics
Expand Down
10 changes: 5 additions & 5 deletions packages/analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![npm](https://img.shields.io/npm/dm/analytics?style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/analytics?style=flat-square) ![GitHub](https://img.shields.io/github/license/davidwells/analytics?style=flat-square)

A lightweight analytics abstraction library for tracking page views, custom events, & identify visitors.
A lightweight analytics abstraction library for tracking page views, custom events, & identify visitors.

Designed to work with any [third-party analytics tool](https://getanalytics.io/plugins/) or your own backend.

Expand Down Expand Up @@ -107,7 +107,7 @@ const analytics = Analytics({
version: 100,
plugins: [
googleAnalytics({
trackingId: 'UA-121991291',
measurementIds: 'UA-121991291',
}),
customerIo({
siteId: '123-xyz'
Expand Down Expand Up @@ -148,7 +148,7 @@ analytics.identify('user-id-xyz', {
version: 100,
plugins: [
googleAnalytics({
trackingId: 'UA-121991291',
measurementIds: 'UA-121991291',
}),
customerIo({
siteId: '123-xyz'
Expand Down Expand Up @@ -590,7 +590,7 @@ analytics.storage.removeItem('storage_key')

### analytics.plugins

Async Management methods for plugins.
Async Management methods for plugins.

This is also where [custom methods](https://bit.ly/329vFXy) are loaded into the instance.

Expand Down Expand Up @@ -901,7 +901,7 @@ const analytics = Analytics({
// include myPlugin
myPlugin(),
customerIoPlugin({
trackingId: '1234'
measurementIds: '1234'
})
...otherPlugins
]
Expand Down
8 changes: 4 additions & 4 deletions packages/use-analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const analytics = Analytics({
app: 'awesome-app',
plugins: [
googleAnalytics({
trackingId: 'UA-1234567',
measurementIds: 'UA-1234567',
})
]
})
Expand Down Expand Up @@ -128,7 +128,7 @@ const analytics = Analytics({
app: 'awesome-app',
plugins: [
googleAnalytics({
trackingId: 'UA-1234567',
measurementIds: 'UA-1234567',
})
]
})
Expand Down Expand Up @@ -213,7 +213,7 @@ const analytics = Analytics({
app: 'awesome-app',
plugins: [
googleAnalytics({
trackingId: 'UA-1234567',
measurementIds: 'UA-1234567',
})
]
})
Expand Down Expand Up @@ -272,7 +272,7 @@ const analytics = Analytics({
app: 'awesome-app',
plugins: [
googleAnalytics({
trackingId: 'UA-1234567',
measurementIds: 'UA-1234567',
})
]
})
Expand Down
2 changes: 1 addition & 1 deletion site/gatsby-theme-oss-docs/src/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const analytics = Analytics({
debug: true,
plugins: [
googleAnalytics({
trackingId: 'UA-126647663-4'
measurementIds: 'UA-126647663-4'
})
]
})
Expand Down
14 changes: 7 additions & 7 deletions site/main/source/conditional-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const analytics = Analytics({
app: 'awesome-app',
plugins: [
googleAnalytics({
trackingId: 'ua-111-22222',
// Disable GA from loading
measurementIds: 'ua-111-22222',
// Disable GA from loading
enabled: false,
}),
]
Expand Down Expand Up @@ -70,7 +70,7 @@ const analytics = Analytics({
app: 'awesome-app',
plugins: [
googleAnalytics({
trackingId: 'ua-111-22222',
measurementIds: 'ua-111-22222',
enabled: !dontTrack
})
]
Expand All @@ -89,8 +89,8 @@ const analytics = Analytics({
app: 'awesome-app',
plugins: [
googleAnalyticsPlugin({
trackingId: 'UA-xyz-123',
// Disable GA from loading until `analytics.plugins.enable` called
measurementIds: 'UA-xyz-123',
// Disable GA from loading until `analytics.plugins.enable` called
enabled: false,
}),
hubSpotPlugin({
Expand Down Expand Up @@ -167,7 +167,7 @@ const devOnlyPlugins = [
// prod only plugins
const prodOnlyPlugins = [
googleAnalyticsPlugin({
trackingId: GOOGLE_ANALYTICS
measurementIds: GOOGLE_ANALYTICS
}),
]

Expand All @@ -192,6 +192,6 @@ const analytics = Analytics({
plugins: plugins
})

// Use it
// Use it
analytics.page()
```
2 changes: 1 addition & 1 deletion site/main/source/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const analytics = Analytics({
version: 100,
plugins: [
googleAnalyticsPlugin({
trackingId: 'UA-121991291',
measurementIds: 'UA-121991291',
}),
customerIOPlugin({
siteId: '123-xyz'
Expand Down
2 changes: 1 addition & 1 deletion site/main/source/plugins/event-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const analytics = Analytics({
plugins: [
customValidationPlugin,
googleAnalytics({
trackingId: 'UA-121991123',
measurementIds: 'UA-121991123',
})
]
})
Expand Down
2 changes: 1 addition & 1 deletion site/main/source/plugins/extending-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import googleAnalyticsPlugin from '@analytics/google-analytics'

// Original google analytics plugin with no alterations
const originalGoogleAnalytics = googleAnalytics({
trackingId: '1234'
measurementIds: '1234'
})

function myCustomTrack({ payload }) {
Expand Down
2 changes: 1 addition & 1 deletion site/main/source/plugins/google-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ const analytics = Analytics({
}),
/* Load Google Analytics v3 */
googleAnalyticsV3Plugin({
trackingId: 'UA-11111111-2',
measurementIds: 'UA-11111111-2',
}),
],
})
Expand Down
Loading