Skip to content
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

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f898708
initial commit
spacewoox Jul 3, 2017
718db2c
update README. Provide a documentation that best describes the availa…
spacewoox Jul 3, 2017
6ed977e
add linter configuration
spacewoox Jul 3, 2017
1106b6e
linter compliance
spacewoox Jul 3, 2017
1cbe27c
update linter
spacewoox Jul 3, 2017
17b3a18
update the doc: include test
spacewoox Jul 3, 2017
93f273e
use jest for testing
spacewoox Jul 3, 2017
798de8e
create unit test with jest
spacewoox Jul 3, 2017
40bd6f0
add npm start command in package.json
spacewoox Jul 4, 2017
842a6b2
mock axios sample
spacewoox Jul 4, 2017
4880f5d
doc / improve identify() description
spacewoox Jul 4, 2017
d613068
remove jquery and underscore
spacewoox Jul 4, 2017
3333708
add environment configuration variables
spacewoox Jul 4, 2017
1ba5f39
use API_URL in trackActivity as well
spacewoox Jul 4, 2017
6528d48
create a fakeIdentify to mock api
spacewoox Jul 4, 2017
1885e92
identify now takes a second parameter called options. we can use it t…
spacewoox Jul 4, 2017
22841bd
start get recommendation
spacewoox Jul 4, 2017
969cc52
add getRecommendations in doc
spacewoox Jul 4, 2017
7abdc57
remove gulp
spacewoox Jul 4, 2017
ed4a6af
update samples
spacewoox Jul 4, 2017
7a9eb64
unit test identify
spacewoox Jul 6, 2017
483a58d
put encode test inside a describe
spacewoox Jul 6, 2017
00e3ed5
test profil has changed
spacewoox Jul 6, 2017
1ac08c0
test identify
spacewoox Jul 6, 2017
85a0a02
fix cookie, resolve, core and configurations
spacewoox Sep 17, 2017
f4f2ece
remove preact deps
spacewoox Sep 17, 2017
be880ff
refactor earlybirds-js from ~20kb to 4kb
spacewoox Oct 10, 2017
85af3d6
remove axios. use fetch instead
spacewoox Oct 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
start get recommendation
spacewoox committed Jul 4, 2017
commit 22841bd2f5a50638b5bd61f7959063aa460e16cd
16 changes: 15 additions & 1 deletion src/earlybirds.js
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ class Eb {
hash: null,
lastIdentify: null,
};
this.profile = JSON.parse(Cookies.getCookie('eb-profile'));
}

// public
@@ -87,7 +88,6 @@ class Eb {
response.cookie.domain &&
document.location.hostname.indexOf(response.cookie.domain) >= 0) {
newProfile.cookie = response.cookie;
console.log('reset cookie');
cookieDuration = response.cookie.expires || cookieDuration;
}
Cookies.setCookie('eb-profile', JSON.stringify(newProfile), cookieDuration);
@@ -96,6 +96,20 @@ class Eb {
// console.log(err);
});
}

getRecommendations(widgetId, options) {

return axios({
method: 'GET',
url: `${HTTP_PROTOCOL}${Config.API_URL}/widget/${widgetId}/recommendations/${this.profile.id}`,
})
.then((response) => {
console.log(response);
})
.catch((err) => {
// console.log(err);
});
}
}

module.exports = Eb;