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

Add more web storage options #3

Open
wants to merge 15 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
.idea
.ruby-version
.ruby-gemset
.ddev
node_modules
bower_components
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ sbjs.init({
});
```

There are 11 types of user settings:
There are 12 types of user settings:
* lifetime
* session_length
* web_storage
* domain
* referrals
* organics
Expand All @@ -118,6 +119,10 @@ sbjs.init({
// Set custom session length in minutes
// 30 minutes is default
session_length: 30,

// Set the web storage method
// 'cookies' is default
web_storage: 'cookies',

// Set domain name in cookies
domain: {
Expand Down Expand Up @@ -200,6 +205,19 @@ The rules are the same with Google Analytics:
* Referral source overrides previous source only if there is no user session at the moment. If it’s inside the same session — a referral source will never override previous source.

Explanation to `referral` logic: sometimes visitor within the current visit (session) comes to the website from the “source” which is not actually a “source”. For example, it can be visit from the email service, where he had a registration activation link.
#### web_storage
``` javascript
web_storage: 'cookies'
```
See [PR 3](https://github.com/woocommerce/sourcebuster-js/pull/3) for more details.

Basically, configure where the Sourcebuster data will be stored and manipulated:
- `cookies` (default) — in multiple cookies
- `singleCookie` — in a single, JSON-encoded cookie
- `localStorage` — in browser `local storage`
- `sessionStorage` — in browser `session storage`

Any other value (or no value) will default to `cookies`.
Comment on lines +208 to +220
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paragraph spacing, to be consistent with other spacing in the document:

Suggested change
#### web_storage
``` javascript
web_storage: 'cookies'
```
See [PR 3](https://github.com/woocommerce/sourcebuster-js/pull/3) for more details.
Basically, configure where the Sourcebuster data will be stored and manipulated:
- `cookies` (default) — in multiple cookies
- `singleCookie` — in a single, JSON-encoded cookie
- `localStorage` — in browser `local storage`
- `sessionStorage` — in browser `session storage`
Any other value (or no value) will default to `cookies`.
#### web_storage
```javascript
web_storage: 'cookies'
```javascript
See https://github.com/woocommerce/sourcebuster-js/pull/3 for more details.
Basically, configure where the Sourcebuster data will be stored and manipulated:
- `cookies` (default) — in multiple cookies
- `singleCookie` — in a single, JSON-encoded cookie
- `localStorage` — in browser `local storage`
- `sessionStorage` — in browser `session storage`
Any other value (or no value) will default to `cookies`.


#### Domain

Expand Down