CSR-514 Add PageEntry trigger, move running experiments in router to a private function
This commit is contained in:
parent
5431d13c85
commit
0afa4d815c
1 changed files with 16 additions and 5 deletions
|
|
@ -37,11 +37,7 @@ const routes = [
|
|||
return next(false);
|
||||
}
|
||||
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, {
|
||||
userId: getDeviceIdValue(),
|
||||
triggerEvent: experimentTriggers.SITE_ENTRY,
|
||||
triggerValue: applicationConfig.SITE_ENTRY_TRIGGER_VALUE
|
||||
})
|
||||
runExperiments(to.query.fmgPage);
|
||||
|
||||
// If the saved session has timed out, clear the session, execute 404 logic.
|
||||
if (getFunnelCookie() !== null && !isSavedSessionStillActive()) {
|
||||
|
|
@ -272,4 +268,19 @@ function arePagePrerequisitesValid(component) {
|
|||
return component.default.methods.arePagePrerequisitesValid();
|
||||
}
|
||||
|
||||
// Run SiteEntry and PageEntry triggers for experiments
|
||||
function runExperiments(nextPage) {
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, {
|
||||
userId: getDeviceIdValue(),
|
||||
triggerEvent: experimentTriggers.SITE_ENTRY,
|
||||
triggerValue: applicationConfig.SITE_ENTRY_TRIGGER_VALUE
|
||||
})
|
||||
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, {
|
||||
userId: getDeviceIdValue(),
|
||||
triggerEvent: experimentTriggers.PAGE_ENTRY,
|
||||
triggerValue: nextPage
|
||||
})
|
||||
}
|
||||
|
||||
export default router;
|
||||
|
|
|
|||
Loading…
Reference in a new issue