|
@@ -18,13 +18,14 @@ export class BaseTrack implements IBaseAction, ICustomAction {
|
|
this._endPoint = params.endPoint;
|
|
this._endPoint = params.endPoint;
|
|
this._trackEndPoint = params.trackEndPoint;
|
|
this._trackEndPoint = params.trackEndPoint;
|
|
}
|
|
}
|
|
- public trackView(url: string, referrer: string, uuid: string): void {
|
|
|
|
|
|
+ public trackView(url: string, referrer: string, uuid: string): Promise<XMLHttpRequestResponseType> {
|
|
console.log('BaseTrack-trackView', url, referrer, uuid);
|
|
console.log('BaseTrack-trackView', url, referrer, uuid);
|
|
console.log('111-playload', this._history.playload);
|
|
console.log('111-playload', this._history.playload);
|
|
const payload = Object.assign(this._history.playload, {
|
|
const payload = Object.assign(this._history.playload, {
|
|
referrer: this._history.currentRef,
|
|
referrer: this._history.currentRef,
|
|
|
|
+ ...this._config,
|
|
});
|
|
});
|
|
- collect(this._endPoint, 'pageview', payload);
|
|
|
|
|
|
+ return collect(this._endPoint, 'pageview', payload);
|
|
}
|
|
}
|
|
|
|
|
|
public trackEvent(event_name: string, event_data: string, url?: string, uuid?: string): Promise<XMLHttpRequestResponseType> {
|
|
public trackEvent(event_name: string, event_data: string, url?: string, uuid?: string): Promise<XMLHttpRequestResponseType> {
|
|
@@ -33,6 +34,7 @@ export class BaseTrack implements IBaseAction, ICustomAction {
|
|
referrer: this._history.currentRef,
|
|
referrer: this._history.currentRef,
|
|
event_name: event_name,
|
|
event_name: event_name,
|
|
event_data: event_data,
|
|
event_data: event_data,
|
|
|
|
+ ...this._config,
|
|
});
|
|
});
|
|
return collect(this._endPoint, 'event', payload);
|
|
return collect(this._endPoint, 'event', payload);
|
|
}
|
|
}
|
|
@@ -43,6 +45,7 @@ export class BaseTrack implements IBaseAction, ICustomAction {
|
|
referrer: this._history.currentRef,
|
|
referrer: this._history.currentRef,
|
|
event_name: type,
|
|
event_name: type,
|
|
event_data: value,
|
|
event_data: value,
|
|
|
|
+ ...this._config,
|
|
});
|
|
});
|
|
collect(this._endPoint, 'event', payload);
|
|
collect(this._endPoint, 'event', payload);
|
|
}
|
|
}
|
|
@@ -52,6 +55,7 @@ export class BaseTrack implements IBaseAction, ICustomAction {
|
|
referrer: this._history.currentRef,
|
|
referrer: this._history.currentRef,
|
|
...trackActionOption,
|
|
...trackActionOption,
|
|
trackActionName,
|
|
trackActionName,
|
|
|
|
+ ...this._config,
|
|
});
|
|
});
|
|
collect(this._trackEndPoint, 'track', payload);
|
|
collect(this._trackEndPoint, 'track', payload);
|
|
}
|
|
}
|
|
@@ -61,6 +65,7 @@ export class BaseTrack implements IBaseAction, ICustomAction {
|
|
referrer: this._history.currentRef,
|
|
referrer: this._history.currentRef,
|
|
...trackActionOption,
|
|
...trackActionOption,
|
|
trackActionName,
|
|
trackActionName,
|
|
|
|
+ ...this._config,
|
|
});
|
|
});
|
|
collect(this._trackEndPoint, 'startTrack', payload);
|
|
collect(this._trackEndPoint, 'startTrack', payload);
|
|
if (trackActionOption.maxWaitTime) {
|
|
if (trackActionOption.maxWaitTime) {
|
|
@@ -76,6 +81,7 @@ export class BaseTrack implements IBaseAction, ICustomAction {
|
|
referrer: this._history.currentRef,
|
|
referrer: this._history.currentRef,
|
|
...trackActionOption,
|
|
...trackActionOption,
|
|
trackActionName,
|
|
trackActionName,
|
|
|
|
+ ...this._config,
|
|
});
|
|
});
|
|
collect(this._trackEndPoint, 'endTrack', payload);
|
|
collect(this._trackEndPoint, 'endTrack', payload);
|
|
}
|
|
}
|