mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-08 20:22:53 +03:00
Added missing events for analytics
refs https://github.com/TryGhost/Team/issues/1054 In order to listen to events we must define them! This adds the missing events that we need to listen to for member analytics.
This commit is contained in:
parent
41bdd38237
commit
9fca7ce8f3
@ -1,3 +1,7 @@
|
||||
module.exports = {
|
||||
MemberEntryViewEvent: require('./lib/MemberEntryViewEvent')
|
||||
MemberEntryViewEvent: require('./lib/MemberEntryViewEvent'),
|
||||
MemberUnsubscribeEvent: require('./lib/MemberUnsubscribeEvent'),
|
||||
MemberSignupEvent: require('./lib/MemberSignupEvent'),
|
||||
MemberPaidConverstionEvent: require('./lib/MemberPaidConversionEvent'),
|
||||
MemberPaidCancellationEvent: require('./lib/MemberPaidCancellationEvent')
|
||||
};
|
||||
|
27
ghost/member-events/lib/MemberPaidCancellationEvent.js
Normal file
27
ghost/member-events/lib/MemberPaidCancellationEvent.js
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @typedef {object} MemberPaidCancellationEventData
|
||||
* @prop {string} memberId
|
||||
* @prop {string} memberStatus
|
||||
* @prop {string} subscriptionId
|
||||
* @prop {string} entryId
|
||||
* @prop {string} sourceUrl
|
||||
*/
|
||||
|
||||
module.exports = class MemberPaidCancellationEvent {
|
||||
/**
|
||||
* @param {MemberPaidCancellationEventData} data
|
||||
* @param {Date} timestamp
|
||||
*/
|
||||
constructor(data, timestamp) {
|
||||
this.data = data;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {MemberPaidCancellationEventData} data
|
||||
* @param {Date} [timestamp]
|
||||
*/
|
||||
static create(data, timestamp) {
|
||||
return new MemberPaidCancellationEvent(data, timestamp || new Date);
|
||||
}
|
||||
};
|
27
ghost/member-events/lib/MemberPaidConversionEvent.js
Normal file
27
ghost/member-events/lib/MemberPaidConversionEvent.js
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @typedef {object} MemberPaidConversionEventData
|
||||
* @prop {string} memberId
|
||||
* @prop {string} memberStatus
|
||||
* @prop {string} subscriptionId
|
||||
* @prop {string} entryId
|
||||
* @prop {string} sourceUrl
|
||||
*/
|
||||
|
||||
module.exports = class MemberPaidConversionEvent {
|
||||
/**
|
||||
* @param {MemberPaidConversionEventData} data
|
||||
* @param {Date} timestamp
|
||||
*/
|
||||
constructor(data, timestamp) {
|
||||
this.data = data;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {MemberPaidConversionEventData} data
|
||||
* @param {Date} [timestamp]
|
||||
*/
|
||||
static create(data, timestamp) {
|
||||
return new MemberPaidConversionEvent(data, timestamp || new Date);
|
||||
}
|
||||
};
|
26
ghost/member-events/lib/MemberSignupEvent.js
Normal file
26
ghost/member-events/lib/MemberSignupEvent.js
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @typedef {object} MemberSignupEventData
|
||||
* @prop {string} memberId
|
||||
* @prop {string} entryId
|
||||
* @prop {string} sourceUrl
|
||||
*/
|
||||
|
||||
module.exports = class MemberSignupEvent {
|
||||
/**
|
||||
* @param {MemberSignupEventData} data
|
||||
* @param {Date} timestamp
|
||||
*/
|
||||
constructor(data, timestamp) {
|
||||
this.data = data;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {MemberSignupEventData} data
|
||||
* @param {Date} [timestamp]
|
||||
*/
|
||||
static create(data, timestamp) {
|
||||
return new MemberSignupEvent(data, timestamp || new Date);
|
||||
}
|
||||
};
|
||||
|
26
ghost/member-events/lib/MemberUnsubscribeEvent.js
Normal file
26
ghost/member-events/lib/MemberUnsubscribeEvent.js
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @typedef {object} MemberUnsubscribeEventData
|
||||
* @prop {string} memberId
|
||||
* @prop {string} memberStatus
|
||||
* @prop {string} entryId
|
||||
* @prop {string} sourceUrl
|
||||
*/
|
||||
|
||||
module.exports = class MemberUnsubscribeEvent {
|
||||
/**
|
||||
* @param {MemberUnsubscribeEventData} data
|
||||
* @param {Date} timestamp
|
||||
*/
|
||||
constructor(data, timestamp) {
|
||||
this.data = data;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {MemberUnsubscribeEventData} data
|
||||
* @param {Date} [timestamp]
|
||||
*/
|
||||
static create(data, timestamp) {
|
||||
return new MemberUnsubscribeEvent(data, timestamp || new Date);
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user