update: analytics debugging

This commit is contained in:
CuriousMagpie
2022-09-09 16:27:25 -04:00
parent e6f903fd2e
commit 771558e1fd
2 changed files with 31 additions and 31 deletions

View File

@@ -140,7 +140,7 @@
v-if="paymentData.paymentType !== 'groupPlan'" v-if="paymentData.paymentType !== 'groupPlan'"
v-once v-once
class="btn btn-primary" class="btn btn-primary"
@click="onwards()" @click="submit()"
> >
{{ $t('onwards') }} {{ $t('onwards') }}
</button> </button>
@@ -310,7 +310,8 @@ export default {
gem: gemIcon, gem: gemIcon,
}), }),
paymentData: {}, paymentData: {},
upgradedGroupInfo: { upgradedGroup: {
name: '',
demographics: null, demographics: null,
}, },
}; };
@@ -325,19 +326,21 @@ export default {
isFromBalance () { isFromBalance () {
return this.paymentData.paymentType === 'gift-gems-balance'; return this.paymentData.paymentType === 'gift-gems-balance';
}, },
upgradedGroup () { // upgradedGroup () {
const upgradedGroup = (this.paymentData.paymentType !== 'groupPlan' || this.paymentData.newGroup); // const upgradedGroup = (this.paymentData.paymentType === 'groupPlan'
const demographicsKey = upgradedGroup.demographics; // && !this.paymentData.newGroup);
const upgradedGroupName = upgradedGroup.name; // const demographicsKey = upgradedGroup.demographics;
const upgradedGroupType = upgradedGroup.type; // const upgradedGroupName = upgradedGroup.name;
const groupPlanUpgraded = { // const upgradedGroupType = upgradedGroup.type;
demographics: demographicsKey, // const groupPlanUpgraded = {
name: upgradedGroupName, // demographics: demographicsKey,
type: upgradedGroupType, // name: upgradedGroupName,
}; // type: upgradedGroupType,
console.log(groupPlanUpgraded.demographics, groupPlanUpgraded.name, groupPlanUpgraded.type); // };
return (groupPlanUpgraded.demographics, groupPlanUpgraded.name, groupPlanUpgraded.type); // console.log(groupPlanUpgraded.demographics,
}, // groupPlanUpgraded.name, groupPlanUpgraded.type);
// return groupPlanUpgraded;
// },
}, },
mounted () { mounted () {
this.$root.$on('habitica:payment-success', data => { this.$root.$on('habitica:payment-success', data => {
@@ -354,19 +357,16 @@ export default {
}, },
methods: { methods: {
submit () { submit () {
if (!this.paymentData.newGroup) {
Analytics.track({ Analytics.track({
hitType: 'event', hitType: 'event',
eventName: 'group plan upgrade', eventName: 'group plan upgrade',
eventAction: 'group plan upgrade', eventAction: 'group plan upgrade',
eventCategory: 'behavior', eventCategory: 'behavior',
upgradedGroupName: this.upgradedGroup.name, demographics: this.paymentData.group.demographics, // if that's where this lives?
demographicsUpgraded: this.upgradedGroup.demographics, typeUpgraded: this.paymentData.group.type,
typeUpgraded: this.upgradedGroup.type,
}); });
this.paymentData = {}; }
this.$root.$emit('bv::hide::modal', 'payments-success-modal');
},
onwards () {
this.paymentData = {}; this.paymentData = {};
this.$root.$emit('bv::hide::modal', 'payments-success-modal'); this.$root.$emit('bv::hide::modal', 'payments-success-modal');
}, },

View File

@@ -86,9 +86,9 @@ function _gatherGroupStats (properties) {
properties.createGroupName = group.newGroup.name; properties.createGroupName = group.newGroup.name;
properties.demographicsCreated = group.newGroup.demographics; properties.demographicsCreated = group.newGroup.demographics;
properties.typeCreated = group.newGroup.type; properties.typeCreated = group.newGroup.type;
properties.upgradedGroupName = group.upgradedGroup.name; // properties.upgradedGroupName = group.upgradedGroup.name;
properties.demographicsUpgraded = group.upgradedGroup.demographics; // properties.demographicsUpgraded = group.upgradedGroup.demographics;
properties.typeUpgraded = group.upgradedGroup.type; // properties.typeUpgraded = group.upgradedGroup.type;
} }
export function setUser () { export function setUser () {