Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3bca31e

Browse files
authored
Update cookie-validity-update.md A.js Cookie methods
1 parenteca2a51 commit3bca31e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/connections/sources/catalog/libraries/website/javascript/cookie-validity-update.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,15 @@ You can still manually track identity by calling `analytics.identify()` with the
127127
Analytics.js tries to detect when a page is about to be closed and saves pending events to`localStorage`. When the user navigates to another page within the same domain, Analytics.js attempts to send any events it finds in localStorage.
128128

129129
When`disableClientPersistence` is set to`true`, Analytics.js won't store any pending events into`localStorage`.
130+
131+
##Client Side Cookie Methods (Get, Set, Clear)
132+
133+
To access or assign a value to a cookie, outside of the standard Segment methods (track/identify/page/group), you can use the following methods. To access the cookie's value pass an empty`()` at the end of the method. To assign the value, include the string value inside those parenthesis`('123-abc')`. To clear (remove) the value for a specific field, pass in an empty value of its type, for string`('')`, for object`({})`.
134+
135+
| Field| Cookie Name| Analytics.js Method| Local Storage Method| Set Example| Clear Example|
136+
| -----| -----------| -------------------| --------------------| ---------------| -------------|
137+
|`userId`|`ajs_user_id`|`analytics.user().id();`|`window.localStorage.ajs_user_id`|`analytics.user().id('123-abc');`|`analytics.user().id('');`|
138+
|`anonymousId`|`ajs_anonymous_id`|`analytics.user().anonymousId();`|`window.localStorage.ajs_anonymous_id`|`analytics.user().anonymousId('333-abc-456-dfg');`|`analytics.user().anonymousId('');`|
139+
|`user traits`|`ajs_user_traits`|`analytics.user().traits();`|`window.localStorage.ajs_user_traits`|`analytics.user().traits({firstName:'Jane'});`|`analytics.user().traits({});`|
140+
|`groupId`|`ajs_group_id`|`analytics.group().id();`|`window.localStorage.ajs_group_id`|`analytics.group().id('777-qwe-098');`|`analytics.group().id('');`|
141+
|`group traits`|`ajs_group_properties`|`analytics.group().traits()`|`window.localStorage.ajs_group_properties`|`analytics.group().traits({name:'Segment'})`|`analytics.group().traits({})`|

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp