Skip to content

Add support for Content Grouping #35

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Vue.use(VueAnalytics, {
ignoredViews: ['homepage'], // If router, you can exclude some routes name (case insensitive) (optional)
trackPage: true|false, // Whether you want page changes to be recorded as pageviews (website) or screenviews (app), default: false
createOptions: { // Optional, Option when creating GA tracker, ref: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference
siteSpeedSampleRate: 10,
siteSpeedSampleRate: 10,
},
globalDimensions: [ // Optional
{dimension: 1, value: 'MyDimensionValue'},
Expand All @@ -53,6 +53,11 @@ Vue.use(VueAnalytics, {
{metric: 1, value: 'MyMetricValue'},
{metric: 2, value: 'AnotherMetricValue'}
]
],
globalContentGroups: [ // Optional
{contentGroup: 1, value: 'MyContentGroupValue'},
{contentGroup: 2, value: 'AnotherContentGroupValue'}
]
})
```

Expand Down Expand Up @@ -95,7 +100,7 @@ This feature will generate the view name according to a priority rule :

Most of time the second case is enough, but sometimes you want to have more control on what is sent, this is where the first rule shine.

Example :
Example :
```javascript
const myRoute = {
path: 'myRoute',
Expand Down Expand Up @@ -126,7 +131,7 @@ const myRoute = {
```javascript
/**
* Dispatch a view using the screen name
*
*
* @param screenName {string}
* @param trackPage {boolean} - Whether you want the dispatched view to be recorded as pageview (website) or screenview (app)
*/
Expand All @@ -152,7 +157,7 @@ const myRoute = {
*
* @param {int} dimensionNumber
* @param {string|int} value
*
*
* @throws Error - If already defined
*/
```
Expand All @@ -166,7 +171,21 @@ const myRoute = {
*
* @param {int} metricNumber
* @param {string|int} value
*
*
* @throws Error - If already defined
*/
```

### injectGlobalContentGroups (contentGroupNumber, value)
```javascript
/**
* Inject a new GlobalContentGroups that will be sent every time.
*
* Prefer inject through plugin configuration.
*
* @param {int} contentGroupNumber
* @param {string|int} value
*
* @throws Error - If already defined
*/
```
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-analytics.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading