diff --git a/README.md b/README.md
index 099215c..3368d29 100644
--- a/README.md
+++ b/README.md
@@ -1,29 +1,27 @@
> :warning: **This plugin will stop receiving feature requests. I will only spend time for important bug fixes**. Google moved from analytics.js to its new gtag.js library and I've created a new plugin called [vue-gtag](https://github.com/MatteoGabriele/vue-gtag). I suggest you to start using that one if you are about to create a new project.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
# vue-analytics
Vue plugin for Google Analytics
-
## Why should I use it?
The plugin isn't just a wrapper of the Google Analytics API, but provides a solution to issues that most of the time you don't want to deal with or you not even know you have to deal with.
@@ -45,6 +43,7 @@ For example:
Vue ^2.0.0
## Articles
+
[Google Analytics, GDPR and Vuejs](https://medium.com/@matteo_gabriele/google-analytics-gdpr-and-vuejs-e1bd6affd2b4)
[Vuejs and Google Analytics](https://medium.com/@matteo_gabriele/vuejs-and-google-analytics-689a07e00116)
@@ -84,7 +83,6 @@ npm install vue-analytics
* [Custom analytics.js URL](/docs/custom-analytics.md)
* [Debug](/docs/debug.md)
-
# Issues and features requests
Please drop an issue, if you find something that doesn't work, or a feature request at [https://github.com/MatteoGabriele/vue-analytics/issues](https://github.com/MatteoGabriele/vue-analytics/issues)
diff --git a/vue-analytics.d.ts b/vue-analytics.d.ts
index 575d792..0815905 100644
--- a/vue-analytics.d.ts
+++ b/vue-analytics.d.ts
@@ -4,14 +4,16 @@ declare module 'vue-analytics' {
import VueRouter, { Route } from 'vue-router';
import { Store } from 'vuex';
+ interface EventPayload {
+ eventCategory: string;
+ eventAction?: string;
+ eventLabel?: string;
+ eventValue?: number;
+ }
+
interface eventFn {
(category: string, action?: string, label?: string, value?: number): void;
- (options: {
- eventCategory: string,
- eventAction?: string,
- eventLabel?: string,
- eventValue?: number
- }): void;
+ (options: EventPayload): void;
}
type pageDetails = {
@@ -36,23 +38,27 @@ declare module 'vue-analytics' {
(options: Record): void;
}
+ interface SocialPayload {
+ socialNetwork: string;
+ socialAction: string;
+ socialTarget: string;
+ }
+
interface socialFn {
(network: string, action: string, target: string): void;
- (options: {
- socialNetwork: string,
- socialAction: string,
- socialTarget: string
- }): void;
+ (options: SocialPayload): void;
+ }
+
+ interface TimePayload {
+ timingCategory: string;
+ timingVar: string;
+ timingValue: number;
+ timingLabel: string;
}
interface timeFn {
(category: string, variable: string, value: number, label: string): void;
- (options: {
- timingCategory: string,
- timingVar: string,
- timingValue: number,
- timingLabel: string
- }): void;
+ (options: TimePayload): void;
}
interface EcommerceItem {
@@ -159,12 +165,14 @@ declare module 'vue-analytics' {
send(): void;
}
+ interface ScreenViewPayload {
+ screenName: string;
+ [otherProperties: string]: any;
+ }
+
interface screenviewFn {
(screen: string) :void;
- (option: {
- screenName: string;
- [otherProperties: string]: any;
- }): void;
+ (option: ScreenViewPayload): void;
}
interface requireFn {