Skip to content

Commit 6fa02dc

Browse files
authored
Version 5.3.0
2 parents 89bf2b6 + b70af05 commit 6fa02dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1778
-1388
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### Version 5.3.0 (25th March 2021)
2+
#### Added
3+
- Added `getWebUUID` method to access SDK generated ID `web_uuid`.
4+
- Added `getAttribution` method to access user's current attribution information.
5+
6+
#### Fixed
7+
- Fixed issue with URL strategy retrying to send requests after SDK was disabled.
8+
9+
---
10+
111
### Version 5.2.1 (16th September 2021)
212
#### Fixed
313
- Fixed top-level Typescript declarations.

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ To lazy <a id="loading-snippet">load the Adjust Web SDK through CDN</a> paste th
3737

3838
The Adjust Web SDK should be loaded only once per page and it should be initiated once per page load.
3939

40-
When loading the sdk through CDN we suggest using minified version. You can target specific version like `https://cdn.adjust.com/adjust-5.2.1.min.js`, or you can target latest version `https://cdn.adjust.com/adjust-latest.min.js` if you want automatic updates without need to change the target file. The sdk files are cached so they are served as fast as possible, and the cache is refreshed every half an hour. If you want updates immediately make sure to target specific version.
40+
When loading the sdk through CDN we suggest using minified version. You can target specific version like `https://cdn.adjust.com/adjust-5.3.0.min.js`, or you can target latest version `https://cdn.adjust.com/adjust-latest.min.js` if you want automatic updates without need to change the target file. The sdk files are cached so they are served as fast as possible, and the cache is refreshed every half an hour. If you want updates immediately make sure to target specific version.
4141

4242
It's also possible to install our sdk through NPM:
4343

@@ -385,6 +385,36 @@ Example:
385385
Adjust.disableThirdPartySharing();
386386
```
387387

388+
## <a id="getters-web-uuid">Get `web_uuid`</a>
389+
390+
To identify unique web users in Adjust, Web SDK generates an ID known as `web_uuid` whenever it tracks first session. The ID is created per subdomain and per browser.
391+
The identifier follows the Universally Unique Identifier (UUID) format.
392+
393+
To get `web_uuid` use the following method:
394+
395+
<a id="get-web-uuid">**getWebUUID**</a>
396+
397+
Example:
398+
399+
```js
400+
const webUUID = Adjust.getWebUUID();
401+
```
402+
403+
## <a id="getters-attribution">User attribution</a>
404+
405+
You can access your user's current attribution information by using the following method:
406+
407+
<a id="get-attribution">**getAttribution**</a>
408+
409+
Example:
410+
411+
```js
412+
const attribution = Adjust.getAttribution();
413+
```
414+
415+
> **Note** Current attribution information is only available after our backend tracks the app install and triggers the attribution callback.
416+
It is not possible to access a user's attribution value before the SDK has been initialized and the attribution callback has been triggered.
417+
388418
## <a id="license">License</a>
389419

390420
The Adjust SDK is licensed under the MIT License.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.2.1
1+
5.3.0

dist/adjust-latest.d.ts

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,36 @@ declare namespace Adjust {
6868
}
6969

7070
type LogLevel = 'none' | 'error' | 'warning' | 'info' | 'verbose'
71+
72+
interface Attribution {
73+
74+
/** Adjust device identifier */
75+
adid: string,
76+
77+
/** Tracker token */
78+
tracker_token: string,
79+
80+
/** Tracker name */
81+
tracker_name: string,
82+
83+
/** Network grouping level */
84+
network?: string,
85+
86+
/** Campaign grouping level */
87+
campaign?: string,
88+
89+
/** Ad group grouping level */
90+
adgroup?: string,
91+
92+
/** Creative grouping level */
93+
creative?: string,
94+
95+
/** Click label */
96+
click_label?: string,
97+
98+
/** Attribution state, for example 'installed' or 'reattributed' */
99+
state: string
100+
}
71101

72102
interface InitOptions {
73103

@@ -121,7 +151,7 @@ declare namespace Adjust {
121151
* // attribution: details about the changed attribution
122152
* }
123153
* }); */
124-
attributionCallback?: (e: string, attribution: Object) => any;
154+
attributionCallback?: (e: string, attribution: Attribution) => any;
125155

126156
/** Optional. Logging level used by SDK instance. By default this param is set to `error`. We highly recommend that
127157
* you use `verbose` when testing in order to see precise logs and to make sure integration is done properly.
@@ -160,6 +190,30 @@ declare namespace Adjust {
160190
*/
161191
function initSdk({ logLevel, logOutput, ...options }: InitOptions): void
162192

193+
/**
194+
* Get user's current attribution information
195+
*
196+
* Current attribution information is only available after our backend tracks the app install and triggers the
197+
* attribution callback. It is not possible to access a user's attribution value before the SDK has been initialized
198+
* and the attribution callback has been triggered.
199+
*
200+
* @returns current attribution information if available or `undefined` otherwise
201+
*
202+
* @example
203+
* const attribution = Adjust.getAttribution();
204+
*/
205+
function getAttribution (): Attribution | undefined
206+
207+
/**
208+
* Get web_uuid - a unique ID of user generated per subdomain and per browser
209+
*
210+
* @returns `web_uuid` if available or `undefined` otherwise
211+
*
212+
* @example
213+
* const webUuid = Adjust.getWebUUID();
214+
*/
215+
function getWebUUID (): string | undefined
216+
163217
/**
164218
* Track event with already initiated Adjust SDK instance
165219
*

dist/adjust-latest.js

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,7 +2774,7 @@ function isEmptyEntry(value
27742774
|}*/
27752775
var Globals = {
27762776
namespace: "adjust-sdk" || false,
2777-
version: "5.2.1" || false,
2777+
version: "5.3.0" || false,
27782778
env: "production"
27792779
};
27802780
/* harmony default export */ var globals = (Globals);
@@ -4044,7 +4044,7 @@ function timePassed(d1
40444044

40454045

40464046
/*:: //
4047-
import { type UrlT, type ActivityStateMapT, type CommonRequestParams } from './types';*/
4047+
import { type UrlT, type ActivityStateMapT, type AttributionMapT, type CommonRequestParams } from './types';*/
40484048

40494049

40504050

@@ -4439,6 +4439,31 @@ function activity_state_destroy()
44394439
_active = false;
44404440
}
44414441

4442+
function getAttribution()
4443+
/*: AttributionMapT | null*/
4444+
{
4445+
if (!_started) {
4446+
return null;
4447+
}
4448+
4449+
if (!_activityState.attribution) {
4450+
logger.log('No attribution data yet');
4451+
return null;
4452+
}
4453+
4454+
return _activityState.attribution;
4455+
}
4456+
4457+
function getWebUUID()
4458+
/*: string*/
4459+
{
4460+
if (!_started) {
4461+
return null;
4462+
}
4463+
4464+
return _activityState.uuid;
4465+
}
4466+
44424467
var ActivityState = {
44434468
get current() {
44444469
return currentGetter();
@@ -4460,7 +4485,9 @@ var ActivityState = {
44604485
updateSessionLength: updateSessionLength,
44614486
resetSessionOffset: resetSessionOffset,
44624487
updateLastActive: updateLastActive,
4463-
destroy: activity_state_destroy
4488+
destroy: activity_state_destroy,
4489+
getAttribution: getAttribution,
4490+
getWebUUID: getWebUUID
44644491
};
44654492
/* harmony default export */ var activity_state = (ActivityState);
44664493
// CONCATENATED MODULE: ./src/sdk/pub-sub.js
@@ -11532,25 +11559,7 @@ var _excluded = ["logLevel", "logOutput"];
1153211559

1153311560
var main_Promise = typeof Promise === 'undefined' ? __webpack_require__(3).Promise : Promise;
1153411561
/*:: //
11535-
import { type InitOptionsT, type LogOptionsT, type EventParamsT, type GlobalParamsT, type CustomErrorT, type ActivityStateMapT, type SmartBannerOptionsT } from './types';*/
11536-
11537-
11538-
11539-
11540-
11541-
11542-
11543-
11544-
11545-
11546-
11547-
11548-
11549-
11550-
11551-
11552-
11553-
11562+
import { type InitOptionsT, type LogOptionsT, type EventParamsT, type GlobalParamsT, type CustomErrorT, type ActivityStateMapT, type SmartBannerOptionsT, type AttributionMapT } from './types';*/
1155411563

1155511564

1155611565

@@ -11635,6 +11644,34 @@ function initSdk()
1163511644
_start(options);
1163611645
});
1163711646
}
11647+
/**
11648+
* Get user's current attribution information
11649+
*
11650+
* @returns {AttributionMapT|undefined} current attribution information if available or `undefined` otherwise
11651+
*/
11652+
11653+
11654+
function main_getAttribution()
11655+
/*: ?AttributionMapT*/
11656+
{
11657+
return _preCheck('get attribution', function () {
11658+
return activity_state.getAttribution();
11659+
});
11660+
}
11661+
/**
11662+
* Get `web_uuid` - a unique ID of user generated per subdomain and per browser
11663+
*
11664+
* @returns {string|undefined} `web_uuid` if available or `undefined` otherwise
11665+
*/
11666+
11667+
11668+
function main_getWebUUID()
11669+
/*: ?string*/
11670+
{
11671+
return _preCheck('get web_uuid', function () {
11672+
return activity_state.getWebUUID();
11673+
});
11674+
}
1163811675
/**
1163911676
* Track event with already initiated instance
1164011677
*
@@ -12108,7 +12145,9 @@ function _preCheck(description
1210812145
/*: string*/
1210912146
, callback
1211012147
/*: () => mixed*/
12111-
) {
12148+
)
12149+
/*: mixed*/
12150+
{
1211212151
var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
1211312152
schedule = _ref3.schedule,
1211412153
stopBeforeInit = _ref3.stopBeforeInit;
@@ -12133,7 +12172,7 @@ function _preCheck(description
1213312172
scheduler_delay(callback, description);
1213412173
logger.log("Running ".concat(description, " is delayed until Adjust SDK is up"));
1213512174
} else {
12136-
callback();
12175+
return callback();
1213712176
}
1213812177
}
1213912178
}
@@ -12144,6 +12183,8 @@ function _clearDatabase() {
1214412183

1214512184
var Adjust = {
1214612185
initSdk: initSdk,
12186+
getAttribution: main_getAttribution,
12187+
getWebUUID: main_getWebUUID,
1214712188
trackEvent: trackEvent,
1214812189
addGlobalCallbackParameters: addGlobalCallbackParameters,
1214912190
addGlobalPartnerParameters: addGlobalPartnerParameters,

dist/adjust-latest.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/chinese/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
3838

3939
Adjust Web SDK 在每个页面应当仅加载一次,每次页面加载应当初始化一次。
4040

41-
在通过 CDN 加载 SDK 时,我们建议您使用精简版本。您可以定向特定版本,如 `https://cdn.adjust.com/adjust-5.2.1.min.js`;如果您需要自动更新,不想变更目标文件,也可以定向最新版本:`https://cdn.adjust.com/adjust-latest.min.js` 。SDK 文件均有缓存,因此能以最快速度获取,缓存每半小时刷新一次。如果您想立即获得更新,请务必定向特定版本。
41+
在通过 CDN 加载 SDK 时,我们建议您使用精简版本。您可以定向特定版本,如 `https://cdn.adjust.com/adjust-5.3.0.min.js`;如果您需要自动更新,不想变更目标文件,也可以定向最新版本:`https://cdn.adjust.com/adjust-latest.min.js` 。SDK 文件均有缓存,因此能以最快速度获取,缓存每半小时刷新一次。如果您想立即获得更新,请务必定向特定版本。
4242

4343
您也可以通过 NPM 安装我们的 SDK:
4444

docs/japanese/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CDNでAdjustSDKを遅延ロードするためには、以下のコードを`<hea
3838

3939
Adjust Web SDKはページごとに1回だけ読み込まれ、ページの読み込みごとに1回起動される必要があります。
4040

41-
CDNを利用してSDKをロードするときは、縮小バージョンを使用することを推奨します。そうすることで、 `https://cdn.adjust.com/adjust-5.2.1.min.js` のような特定のバージョンをターゲットにしたり、あるいは ターゲットファイルを変更せずに自動更新する場合は、最新バージョン `https://adjust.com/adjust-latest.min.js` をターゲットにすることが可能です。 SDKファイルはキャッシュされるため即時に提供され、更新は30分ごとに行われます。すぐに更新する必要がある場合は、必ず特定のバージョンをターゲットにしてください。
41+
CDNを利用してSDKをロードするときは、縮小バージョンを使用することを推奨します。そうすることで、 `https://cdn.adjust.com/adjust-5.3.0.min.js` のような特定のバージョンをターゲットにしたり、あるいは ターゲットファイルを変更せずに自動更新する場合は、最新バージョン `https://adjust.com/adjust-latest.min.js` をターゲットにすることが可能です。 SDKファイルはキャッシュされるため即時に提供され、更新は30分ごとに行われます。すぐに更新する必要がある場合は、必ず特定のバージョンをターゲットにしてください。
4242

4343
また、NPMを利用してSDKをインストールすることも可能です:
4444

docs/korean/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Adjust SDK는 CommonJS와 AMD 환경에서 작동하고 CDN을 통해 로딩될
3838

3939
Adjust 웹 SDK는 페이지당 한 번만 로딩되어야 하며 페이지 로딩당 한번만 초기화되어야 합니다.
4040

41-
CDN을 통해 SDK를 로딩할 때 축소 버전을 사용하는 것이 좋습니다. `https://cdn.adjust.com/adjust-5.2.1.min.js`와 같은 특정 버전을 타깃팅하거나 대상 파일을 변경할 필요 없이 자동 업데이트를 원하는 경우 최신 버전`https://cdn.adjust.com/adjust-latest.min.js`을 타깃팅 합니다. sdk 파일은 캐싱되어 최대한 빠르게 제공되며 30분 마다 캐시가 새로고침됩니다. 즉시 업데이트를 원하는 경우에는 특정 버전을 타깃팅해야 합니다.
41+
CDN을 통해 SDK를 로딩할 때 축소 버전을 사용하는 것이 좋습니다. `https://cdn.adjust.com/adjust-5.3.0.min.js`와 같은 특정 버전을 타깃팅하거나 대상 파일을 변경할 필요 없이 자동 업데이트를 원하는 경우 최신 버전`https://cdn.adjust.com/adjust-latest.min.js`을 타깃팅 합니다. sdk 파일은 캐싱되어 최대한 빠르게 제공되며 30분 마다 캐시가 새로고침됩니다. 즉시 업데이트를 원하는 경우에는 특정 버전을 타깃팅해야 합니다.
4242

4343
NPM을 통한 SDK 설치 역시 가능합니다:
4444

0 commit comments

Comments
 (0)