@shopgate/pwa-tracking 7.12.5 → 7.12.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/streams/user.js +5 -2
- package/subscriptions/user.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-tracking",
|
|
3
|
-
"version": "7.12.
|
|
3
|
+
"version": "7.12.6-beta.1",
|
|
4
4
|
"description": "Tracking library for the Shopgate Connect PWA.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"connect"
|
|
16
16
|
],
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@shopgate/pwa-common": "7.12.
|
|
19
|
-
"@shopgate/pwa-common-commerce": "7.12.
|
|
20
|
-
"@shopgate/pwa-core": "7.12.
|
|
21
|
-
"@shopgate/tracking-core": "7.12.
|
|
18
|
+
"@shopgate/pwa-common": "7.12.6-beta.1",
|
|
19
|
+
"@shopgate/pwa-common-commerce": "7.12.6-beta.1",
|
|
20
|
+
"@shopgate/pwa-core": "7.12.6-beta.1",
|
|
21
|
+
"@shopgate/tracking-core": "7.12.6-beta.1",
|
|
22
22
|
"reselect": "^3.0.1",
|
|
23
23
|
"rxjs": "~5.5.12"
|
|
24
24
|
}
|
package/streams/user.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import{userDidLogin$,userDataReceived$}from'@shopgate/engage/user';/**
|
|
1
|
+
import{userDidLogin$,userDataReceived$,registrationSuccess$ as registrationSuccessCore$,REGISTRATION_FORM_LOGIN_STRATEGY}from'@shopgate/engage/user';/**
|
|
2
2
|
* Gets triggered if login was successful and we received the user data.
|
|
3
|
-
*/export var loginSuccess$=userDidLogin
|
|
3
|
+
*/export var loginSuccess$=userDidLogin$// Do not track a login when user was automatically logged in after registration
|
|
4
|
+
.filter(function(_ref){var action=_ref.action;return(action===null||action===void 0?void 0:action.strategy)!==REGISTRATION_FORM_LOGIN_STRATEGY;}).switchMap(function(){return userDataReceived$.first();});/**
|
|
5
|
+
* Gets triggered if registration was successful and we received the user data.
|
|
6
|
+
*/export var registrationSuccess$=registrationSuccessCore$.switchMap(function(){return userDataReceived$.first();});
|
package/subscriptions/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{loginDidFail$}from'@shopgate/engage/user';import{makeGetUser}from"../selectors/user";import{loginSuccess$}from"../streams/user";import{track}from"../helpers/index";/**
|
|
1
|
+
import{loginDidFail$}from'@shopgate/engage/user';import{makeGetUser}from"../selectors/user";import{loginSuccess$,registrationSuccess$}from"../streams/user";import{track}from"../helpers/index";/**
|
|
2
2
|
* Pages tracking subscriptions.
|
|
3
3
|
* @param {Function} subscribe The subscribe function.
|
|
4
4
|
*/export default function user(subscribe){subscribe(loginSuccess$,function(_ref){var getState=_ref.getState;var getUser=makeGetUser();var state=getState();track('loginSuccess',getUser(state),state);});/**
|
|
5
5
|
* Gets triggered if login failed.
|
|
6
|
-
*/subscribe(loginDidFail$,function(_ref2){var getState=_ref2.getState;return track('loginFailed',undefined,getState());});}
|
|
6
|
+
*/subscribe(loginDidFail$,function(_ref2){var getState=_ref2.getState;return track('loginFailed',undefined,getState());});subscribe(registrationSuccess$,function(_ref3){var getState=_ref3.getState;return track('completedRegistration',{registrationType:'E-Mail'},getState());});}
|