|
@@ -20,22 +20,27 @@ export class BaseTrack implements IBaseAction, ICustomAction {
|
|
|
}
|
|
|
public trackView(url: string, referrer: string, uuid: string): Promise<XMLHttpRequestResponseType> {
|
|
|
console.log('BaseTrack-trackView', url, referrer, uuid);
|
|
|
- console.log('111-playload', this._history.playload);
|
|
|
+ this._history.playload.url = url;
|
|
|
const payload = Object.assign(this._history.playload, {
|
|
|
- referrer: this._history.currentRef,
|
|
|
...this._config,
|
|
|
+ referrer: this._history.currentRef,
|
|
|
+ url: url,
|
|
|
});
|
|
|
+ console.log('send-playload', payload);
|
|
|
return collect(this._endPoint, 'pageview', payload);
|
|
|
}
|
|
|
|
|
|
public trackEvent(event_name: string, event_data: string, url?: string, uuid?: string): Promise<XMLHttpRequestResponseType> {
|
|
|
console.log('BaseTrack-TrackEvent', event_name, event_data, url, uuid);
|
|
|
+ this._history.playload.url = url;
|
|
|
const payload = Object.assign(this._history.playload, {
|
|
|
referrer: this._history.currentRef,
|
|
|
event_name: event_name,
|
|
|
+ url: url,
|
|
|
event_data: event_data,
|
|
|
...this._config,
|
|
|
});
|
|
|
+ console.log('send-playload', payload);
|
|
|
return collect(this._endPoint, 'event', payload);
|
|
|
}
|
|
|
|
|
@@ -43,6 +48,7 @@ export class BaseTrack implements IBaseAction, ICustomAction {
|
|
|
console.log('BaseTrack-sendEvent', value, type, url, uuid);
|
|
|
const payload = Object.assign(this._history.playload, {
|
|
|
referrer: this._history.currentRef,
|
|
|
+ url: url,
|
|
|
event_name: type,
|
|
|
event_data: value,
|
|
|
...this._config,
|