diff --git a/README.md b/README.md index 53e328b..456c312 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ npm install vue-analytics * [Track multiple accounts](/docs/track-multiple-accounts.md) * [On Analaytics script ready](/docs/when-google-analytics-is-loaded.md) * [Custom methods](/docs/custom-methods.md) +* [Ecommerce](/docs/ecommerce.md) * [Debug](/docs/debug.md) # Issues and features requests diff --git a/docs/ecommerce.md b/docs/ecommerce.md new file mode 100644 index 0000000..a3957f6 --- /dev/null +++ b/docs/ecommerce.md @@ -0,0 +1,44 @@ +## Ecommerce + +All ecommerce features are built-in in the plugin, so there's no need to require any ecommerce libraries: just enable the ecommerce features from the plugin configuration + +```js +import Vue from 'vue' +import VueAnalytics from 'vue-analytics' + +Vue.use(VueAnalytics, { + id: 'UA-XXX-X', + ecommerce: { + enabled: true + } +}) +``` + +It is also possible to use the Enhanced Ecommerce library just by change it the configuration like so + +```js +Vue.use(VueAnalytics, { + id: 'UA-XXX-X', + ecommerce: { + enabled: true, + enhanced: true + } +}) +``` + +Finally it's possible to pass addition option during the installation of the library + +```js +Vue.use(VueAnalytics, { + id: 'UA-XXX-X', + ecommerce: { + enabled: true, + options: { ... } + } +}) +``` + +All the available features are documented in Google Analytics dev guide + +- [Ecommerce](https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce) +- [Enhanced Ecommerce](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce) \ No newline at end of file