-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev/features identify and trackactivity #1
base: master
Are you sure you want to change the base?
Conversation
spacewoox
commented
Jul 3, 2017
- initial documentation
- eslint compliant
- test ready with Jest
README.md
Outdated
``` | ||
|
||
## identify(profile) | ||
Then, you need to identify the user by providing a profile object with at least a **datasources** key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The datasource is not mandatory. Furthermore, when you set up a datasource, you need to set the id AND the original_id.
You can read this part of the doc : http://doc.early-birds.fr/#identification-dun-utilisateur-nominatif
README.md
Outdated
```js | ||
const profile = { | ||
datasources: [{ | ||
id: '[DATASOURCE_ID]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a datasource is set, it needs id and original_id
src/earlybirds.js
Outdated
trackActivity(activity) { | ||
return axios({ | ||
method: 'post', | ||
url: `http://api.early-birds.fr/tracker/${this.trackerKey}/activity`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The URL "api.early-birds.fr" should be in a specific var, so it can be override with preprod-api or something like that if needed.
- API should be called through http if it's called by an http website, otherwise, it should be called through https.
src/earlybirds.js
Outdated
identifyRequest(profile) { | ||
return axios({ | ||
method: 'post', | ||
url: `http://api.early-birds.fr/tracker/${this.trackerKey}/identify`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here : http/https and api.early-birds.fr --> in a var
src/earlybirds.js
Outdated
document.location.hostname.indexOf(response.cookie.domain) >= 0) { | ||
newProfile.cookie = response.cookie; | ||
} | ||
Cookies.setCookie('eb-profile', JSON.stringify(newProfile)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cookie expire must be defined to 3 months by default. It can be changed through a parameter (SDK configuration or identify parameter). It can also be changed through the API (response.cookie.expire)
package.json
Outdated
"axios": "^0.16.2", | ||
"babel-polyfill": "^6.23.0", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"jquery": "^3.2.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependency to jQuery ?
package.json
Outdated
"babel-preset-stage-2": "^6.24.1", | ||
"jquery": "^3.2.1", | ||
"lodash": "^4.17.4", | ||
"underscore": "^1.8.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both lodash and underscore ? We should reduce the file weight at maximum, so perhaps we don't need those librairies, but at least, we don't need both
…o setup a default cookie duration
7475836
to
85a0a02
Compare