Skip to content

Commit

Permalink
Merge pull request #1424 from Quetzacoalt91/open-remarketing-setup-wh…
Browse files Browse the repository at this point in the history
…en-not-set

Open remarketing tag popin when after closing the config success popin
  • Loading branch information
Quetzacoalt91 authored Mar 27, 2023
2 parents ac6f693 + 3156d08 commit 925508d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 38 deletions.
18 changes: 2 additions & 16 deletions _dev/apps/ui/src/components/campaigns/campaign-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,14 @@ export default {
default: true,
},
},
computed: {
accountHasAtLeastOneCampaign() {
return !!this.$store.getters['campaigns/GET_ALL_CAMPAIGNS']?.length;
},
remarketingTagIsSet() {
return this.$store.getters['campaigns/GET_REMARKETING_TRACKING_TAG_IS_SET'];
},
},
methods: {
openPopinActivateTracking() {
this.$segment.track('[GGL] Create SSC Config tab', {
module: 'psxmarketingwithgoogle',
params: SegmentGenericParams,
});
// Prevent popin for opening if tracking is a campaign exists
if (this.accountHasAtLeastOneCampaign && this.remarketingTagIsSet) {
this.$router.push({
name: 'campaign-creation',
});
} else {
this.$emit('openPopin');
}
this.$emit('openPopin');
},
},
};
Expand Down
17 changes: 3 additions & 14 deletions _dev/apps/ui/src/components/commons/popin-configured.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ export default {
],
};
},
computed: {
accountHasAtLeastOneCampaign() {
return !!this.$store.getters['campaigns/GET_ALL_CAMPAIGNS']?.length;
},
},
methods: {
cancel() {
this.$refs.modal.hide();
Expand All @@ -86,15 +81,9 @@ export default {
module: 'psxmarketingwithgoogle',
params: SegmentGenericParams,
});
// Prevent popin for opening if tracking is a campaign exists
if (this.accountHasAtLeastOneCampaign) {
this.$router.push({
name: 'campaign-creation',
});
} else {
this.$refs.modal.hide();
this.$emit('openPopinRemarketingTag');
}
this.$refs.modal.hide();
this.$emit('openPopinRemarketingTag');
},
},
};
Expand Down
23 changes: 15 additions & 8 deletions _dev/apps/ui/src/views/onboarding-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
v-if="stepsAreCompleted.step2"
:is-enabled="stepsAreCompleted.step3"
:loading="SSCIsLoading"
@openPopin="onOpenPopinActivateTracking"
@openPopin="proceedToCampaignCreation"
@remarketingTagHasBeenActivated="checkAndOpenPopinConfigrationDone"
/>
<CampaignTracking
v-if="getRemarketingTag !== null && accountHasAtLeastOneCampaign"
v-if="remarketingTagIsSet !== null && accountHasAtLeastOneCampaign"
/>
<PromoCard />
</div>
Expand Down Expand Up @@ -132,7 +132,7 @@
/>
<PopinModuleConfigured
ref="PopinModuleConfigured"
@openPopinRemarketingTag="onOpenPopinActivateTracking"
@openPopinRemarketingTag="proceedToCampaignCreation"
/>
<!-- Toasts -->
<PsToast
Expand Down Expand Up @@ -254,10 +254,17 @@ export default {
this.$refs.GoogleAdsAccountPopinNew.$refs.modal.id,
);
},
onOpenPopinActivateTracking() {
this.$bvModal.show(
this.$refs.SSCPopinActivateTrackingOnboardingPage.$refs.modal.id,
);
proceedToCampaignCreation() {
// If the remarketing tag is not set yet, open the modal
if (!this.accountHasAtLeastOneCampaign || !this.remarketingTagIsSet) {
this.$bvModal.show(
this.$refs.SSCPopinActivateTrackingOnboardingPage.$refs.modal.id,
);
return;
}
this.$router.push({
name: 'campaign-creation',
});
},
toastIsClosed() {
if (this.googleAccountConnectedOnce) {
Expand Down Expand Up @@ -379,7 +386,7 @@ export default {
accountHasAtLeastOneCampaign() {
return !!this.$store.getters['campaigns/GET_ALL_CAMPAIGNS']?.length;
},
getRemarketingTag() {
remarketingTagIsSet() {
return this.$store.getters['campaigns/GET_REMARKETING_TRACKING_TAG_IS_SET'];
},
stepsAreCompleted() {
Expand Down

0 comments on commit 925508d

Please sign in to comment.