Skip to content

Commit

Permalink
Version 5.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
YaraMatkova authored Mar 25, 2022
2 parents 89bf2b6 + b70af05 commit 6fa02dc
Show file tree
Hide file tree
Showing 41 changed files with 1,778 additions and 1,388 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### Version 5.3.0 (25th March 2021)
#### Added
- Added `getWebUUID` method to access SDK generated ID `web_uuid`.
- Added `getAttribution` method to access user's current attribution information.

#### Fixed
- Fixed issue with URL strategy retrying to send requests after SDK was disabled.

---

### Version 5.2.1 (16th September 2021)
#### Fixed
- Fixed top-level Typescript declarations.
Expand Down
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To lazy <a id="loading-snippet">load the Adjust Web SDK through CDN</a> paste th

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

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.
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.

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

Expand Down Expand Up @@ -385,6 +385,36 @@ Example:
Adjust.disableThirdPartySharing();
```

## <a id="getters-web-uuid">Get `web_uuid`</a>

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.
The identifier follows the Universally Unique Identifier (UUID) format.

To get `web_uuid` use the following method:

<a id="get-web-uuid">**getWebUUID**</a>

Example:

```js
const webUUID = Adjust.getWebUUID();
```

## <a id="getters-attribution">User attribution</a>

You can access your user's current attribution information by using the following method:

<a id="get-attribution">**getAttribution**</a>

Example:

```js
const attribution = Adjust.getAttribution();
```

> **Note** Current attribution information is only available after our backend tracks the app install and triggers the attribution callback.
It is not possible to access a user's attribution value before the SDK has been initialized and the attribution callback has been triggered.

## <a id="license">License</a>

The Adjust SDK is licensed under the MIT License.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.1
5.3.0
56 changes: 55 additions & 1 deletion dist/adjust-latest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,36 @@ declare namespace Adjust {
}

type LogLevel = 'none' | 'error' | 'warning' | 'info' | 'verbose'

interface Attribution {

/** Adjust device identifier */
adid: string,

/** Tracker token */
tracker_token: string,

/** Tracker name */
tracker_name: string,

/** Network grouping level */
network?: string,

/** Campaign grouping level */
campaign?: string,

/** Ad group grouping level */
adgroup?: string,

/** Creative grouping level */
creative?: string,

/** Click label */
click_label?: string,

/** Attribution state, for example 'installed' or 'reattributed' */
state: string
}

interface InitOptions {

Expand Down Expand Up @@ -121,7 +151,7 @@ declare namespace Adjust {
* // attribution: details about the changed attribution
* }
* }); */
attributionCallback?: (e: string, attribution: Object) => any;
attributionCallback?: (e: string, attribution: Attribution) => any;

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

/**
* Get user's current attribution information
*
* Current attribution information is only available after our backend tracks the app install and triggers the
* attribution callback. It is not possible to access a user's attribution value before the SDK has been initialized
* and the attribution callback has been triggered.
*
* @returns current attribution information if available or `undefined` otherwise
*
* @example
* const attribution = Adjust.getAttribution();
*/
function getAttribution (): Attribution | undefined

/**
* Get web_uuid - a unique ID of user generated per subdomain and per browser
*
* @returns `web_uuid` if available or `undefined` otherwise
*
* @example
* const webUuid = Adjust.getWebUUID();
*/
function getWebUUID (): string | undefined

/**
* Track event with already initiated Adjust SDK instance
*
Expand Down
89 changes: 65 additions & 24 deletions dist/adjust-latest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2774,7 +2774,7 @@ function isEmptyEntry(value
|}*/
var Globals = {
namespace: "adjust-sdk" || false,
version: "5.2.1" || false,
version: "5.3.0" || false,
env: "production"
};
/* harmony default export */ var globals = (Globals);
Expand Down Expand Up @@ -4044,7 +4044,7 @@ function timePassed(d1


/*:: //
import { type UrlT, type ActivityStateMapT, type CommonRequestParams } from './types';*/
import { type UrlT, type ActivityStateMapT, type AttributionMapT, type CommonRequestParams } from './types';*/



Expand Down Expand Up @@ -4439,6 +4439,31 @@ function activity_state_destroy()
_active = false;
}

function getAttribution()
/*: AttributionMapT | null*/
{
if (!_started) {
return null;
}

if (!_activityState.attribution) {
logger.log('No attribution data yet');
return null;
}

return _activityState.attribution;
}

function getWebUUID()
/*: string*/
{
if (!_started) {
return null;
}

return _activityState.uuid;
}

var ActivityState = {
get current() {
return currentGetter();
Expand All @@ -4460,7 +4485,9 @@ var ActivityState = {
updateSessionLength: updateSessionLength,
resetSessionOffset: resetSessionOffset,
updateLastActive: updateLastActive,
destroy: activity_state_destroy
destroy: activity_state_destroy,
getAttribution: getAttribution,
getWebUUID: getWebUUID
};
/* harmony default export */ var activity_state = (ActivityState);
// CONCATENATED MODULE: ./src/sdk/pub-sub.js
Expand Down Expand Up @@ -11532,25 +11559,7 @@ var _excluded = ["logLevel", "logOutput"];

var main_Promise = typeof Promise === 'undefined' ? __webpack_require__(3).Promise : Promise;
/*:: //
import { type InitOptionsT, type LogOptionsT, type EventParamsT, type GlobalParamsT, type CustomErrorT, type ActivityStateMapT, type SmartBannerOptionsT } from './types';*/


















import { type InitOptionsT, type LogOptionsT, type EventParamsT, type GlobalParamsT, type CustomErrorT, type ActivityStateMapT, type SmartBannerOptionsT, type AttributionMapT } from './types';*/



Expand Down Expand Up @@ -11635,6 +11644,34 @@ function initSdk()
_start(options);
});
}
/**
* Get user's current attribution information
*
* @returns {AttributionMapT|undefined} current attribution information if available or `undefined` otherwise
*/


function main_getAttribution()
/*: ?AttributionMapT*/
{
return _preCheck('get attribution', function () {
return activity_state.getAttribution();
});
}
/**
* Get `web_uuid` - a unique ID of user generated per subdomain and per browser
*
* @returns {string|undefined} `web_uuid` if available or `undefined` otherwise
*/


function main_getWebUUID()
/*: ?string*/
{
return _preCheck('get web_uuid', function () {
return activity_state.getWebUUID();
});
}
/**
* Track event with already initiated instance
*
Expand Down Expand Up @@ -12108,7 +12145,9 @@ function _preCheck(description
/*: string*/
, callback
/*: () => mixed*/
) {
)
/*: mixed*/
{
var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
schedule = _ref3.schedule,
stopBeforeInit = _ref3.stopBeforeInit;
Expand All @@ -12133,7 +12172,7 @@ function _preCheck(description
scheduler_delay(callback, description);
logger.log("Running ".concat(description, " is delayed until Adjust SDK is up"));
} else {
callback();
return callback();
}
}
}
Expand All @@ -12144,6 +12183,8 @@ function _clearDatabase() {

var Adjust = {
initSdk: initSdk,
getAttribution: main_getAttribution,
getWebUUID: main_getWebUUID,
trackEvent: trackEvent,
addGlobalCallbackParameters: addGlobalCallbackParameters,
addGlobalPartnerParameters: addGlobalPartnerParameters,
Expand Down
2 changes: 1 addition & 1 deletion dist/adjust-latest.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/chinese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/japanese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CDNでAdjustSDKを遅延ロードするためには、以下のコードを`<hea

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/korean/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Adjust SDK는 CommonJS와 AMD 환경에서 작동하고 CDN을 통해 로딩될

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

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

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

Expand Down
Loading

0 comments on commit 6fa02dc

Please sign in to comment.