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

Version 5.2.0 #22

Merged
merged 68 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
258e3af
Typescript migration of storage modules part 2 (#68)
Jun 15, 2021
a353e6c
Added Jest typescript types (#77)
Jun 15, 2021
a8aad9a
Add external device ID documentation
Sporiff Jun 30, 2021
3a38427
Merge pull request #79 from adjust/external-device-id
Jul 5, 2021
73584e6
updated project
Jun 24, 2021
d4fd798
ts declarations fixed
Jun 28, 2021
705805d
unused webpack plugin removed
Jun 28, 2021
3510adc
moved html and scss to assets subfolder
Jun 29, 2021
7bee20c
jest config fixed
Jun 29, 2021
3766169
lint issues fixed
Jun 29, 2021
901ecc5
addressed review points
Jun 30, 2021
ac0a4a4
removed html-loader-jest
Jul 1, 2021
1b4f633
addressed review points
Jul 1, 2021
3ddb66d
sticky position with fixed fallback
Jul 1, 2021
0f7f4e6
detect device os
Jul 5, 2021
4f56a65
lint issues fix
Jul 5, 2021
222541c
better wording in test
Jul 6, 2021
c16a06f
removed unneeded nesting in scss
Jul 7, 2021
0a2ab1a
revert package.json
Jul 7, 2021
a0b522b
Merge pull request #78 from adjust/smart-banner/configs-update-single…
Jul 7, 2021
6901cc9
Merge pull request #80 from adjust/smart-banner/detect-os
Jul 7, 2021
934e8d2
added missing declaration for tests
Jul 7, 2021
45e6518
Merge pull request #82 from adjust/smart-banner/fix-types-for-tests
Jul 9, 2021
4a8f7b3
dismiss button added
Jul 7, 2021
0712fee
more specific selectors for demo app styles
Jul 7, 2021
fa676df
fixed class names
Jul 8, 2021
12b14af
added event handler for dismiss btn
Jul 8, 2021
21a6eef
added minimal localStorage wrapper
Jul 8, 2021
8c0b41f
dismissal policy implemented
Jul 8, 2021
1e7b09b
test fixed
Jul 9, 2021
6df8c71
adressed review points
Jul 12, 2021
77cd8e9
local storage tests
Jul 12, 2021
b6b7562
smart banner tests
Jul 15, 2021
2d0d2f2
lint issues fixed
Jul 15, 2021
c4315b7
local storage tests fix
Jul 23, 2021
dde78fb
refactor to support data fetch
Jul 20, 2021
fc0ab97
smart banner tests reworked
Jul 24, 2021
1f6c8e0
added function to clean dismiss button handler
Jul 26, 2021
7edee7c
Merge pull request #83 from adjust/smart-banner/dismiss-policy
Jul 27, 2021
797f7b3
styles adjustments
Jul 16, 2021
832c665
implemented smart banner data fetch
Jul 22, 2021
ac852b4
fix for error handling and urlStrategyRetries compatibility
Jul 22, 2021
56607e9
app icon
Jul 26, 2021
17c245a
refactor: smart banner view module added
Jul 27, 2021
7ee75d6
added tracker link
Jul 28, 2021
ed1cb1c
added logLevel param, removed unneeded public methods
Jul 28, 2021
a98d1ab
utilities tests
Jul 29, 2021
25e5e47
API tests
Jul 29, 2021
e5efe03
refactor: network became a class for testability
Jul 29, 2021
eb9a25b
network tests added
Jul 29, 2021
7e4da06
fix for logOutput when shared logger instance used
Jul 29, 2021
3f32759
lint issue fixed
Jul 29, 2021
03b005d
renamed appWebToken -> webToken
Jul 29, 2021
f71c764
addressed review comments
Jul 30, 2021
bcfea94
addressed more review comments
Aug 2, 2021
a68dd84
removed unneeded exports
Aug 2, 2021
40d086f
Merge pull request #84 from adjust/smart-banner/load-data-and-render
Aug 2, 2021
2e1f7ab
updated distributed files
Aug 2, 2021
b5676d0
Merge pull request #81 from adjust/smart-banner/feature
Aug 2, 2021
4ae9703
demo app on mobile fix
Aug 2, 2021
4f510c8
position fix
Aug 2, 2021
b70af89
avoid position:sticky
Aug 3, 2021
517ace3
Merge pull request #85 from adjust/smart-banner-quick-fixes
Aug 3, 2021
3ea31bd
Version 5.1.3
Aug 3, 2021
9ba707e
snippet updated
Aug 3, 2021
9ce83f7
Version 5.2.0
Aug 3, 2021
743299a
Merge pull request #86 from adjust/v513
Aug 3, 2021
9910664
Merge private/master into v520
Aug 4, 2021
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
10 changes: 8 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"space-before-function-paren": ["error", "always"],
"quotes": ["error", "single"],
"prefer-arrow-callback": "error",
"prefer-object-spread": "error"
"prefer-object-spread": "error",
"flowtype/no-types-missing-file-annotation": "off"
},
"overrides": [
{
Expand All @@ -42,7 +43,12 @@
"plugins": ["@typescript-eslint"],
"rules": {
"semi": ["error", "never"],
"space-before-function-paren": ["error", "never"],
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
"eol-last": "error",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off"
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### Version 5.2.0 (3rd August 2021)
#### Added
- [beta] Smart banners.

---

### Version 5.1.2 (11th June 2021)
#### Added
- Added Typescript support.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ Our sdk is exposed under all module definitions, so it works under CommonJS and
To lazy <a id="loading-snippet">load the Adjust Web SDK through CDN</a> paste the following snippet into the `<head>` tag:
```html
<script type="application/javascript">
!function(t,a,e,r,s,l,d,n,o){t.Adjust=t.Adjust||{},t.Adjust_q=t.Adjust_q||[];for(var c=0;c<l.length;c++)d(t.Adjust,t.Adjust_q,l[c]);n=a.createElement("script"),o=a.getElementsByTagName("script")[0],n.async=!0,n.src="https://cdn.adjust.com/adjust-latest.min.js",n.onload=function(){for(var a=0;a<t.Adjust_q.length;a++)t.Adjust[t.Adjust_q[a][0]].apply(t.Adjust,t.Adjust_q[a][1]);t.Adjust_q=[]},o.parentNode.insertBefore(n,o)}(window,document,0,0,0,["initSdk","trackEvent","addGlobalCallbackParameters","addGlobalPartnerParameters","removeGlobalCallbackParameter","removeGlobalPartnerParameter","clearGlobalCallbackParameters","clearGlobalPartnerParameters","switchToOfflineMode","switchBackToOnlineMode","stop","restart","gdprForgetMe","disableThirdPartySharing"],function(t,a,e){t[e]=function(){a.push([e,arguments])}});
!function(t,a,e,r,s,n,l,d,o){t.Adjust=t.Adjust||{},t.Adjust_q=t.Adjust_q||[];for(var c=0;c<n.length;c++)l(t.Adjust,t.Adjust_q,n[c]);d=a.createElement("script"),o=a.getElementsByTagName("script")[0],d.async=!0,d.src="https://cdn.adjust.com/adjust-latest.min.js",d.onload=function(){for(var a=0;a<t.Adjust_q.length;a++)t.Adjust[t.Adjust_q[a][0]].apply(t.Adjust,t.Adjust_q[a][1]);t.Adjust_q=[]},o.parentNode.insertBefore(d,o)}(window,document,0,0,0,["initSdk","trackEvent","addGlobalCallbackParameters","addGlobalPartnerParameters","removeGlobalCallbackParameter","removeGlobalPartnerParameter","clearGlobalCallbackParameters","clearGlobalPartnerParameters","switchToOfflineMode","switchBackToOnlineMode","stop","restart","gdprForgetMe","disableThirdPartySharing","initSmartBanner"],function(t,a,e){t[e]=function(){a.push([e,arguments])}});
</script>
```

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.1.2.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.2.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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.2
5.2.0
39 changes: 37 additions & 2 deletions dist/adjust-latest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ interface EventParams {
partnerParams?: Array<GlobalParams>;
}

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

interface InitOptions {

/** Required to initialise SDK instance, please make sure to provide valid app token. */
Expand Down Expand Up @@ -128,7 +130,7 @@ interface InitOptions {
* - `error` - will print only error message
* - `none` - won't print anything
*/
logLevel?: 'none' | 'error' | 'warning' | 'info' | 'verbose';
logLevel?: LogLevel;

/**
* Optional. Query selector to define html container if you want to see your logs directly on the screen. This could
Expand Down Expand Up @@ -290,6 +292,38 @@ function gdprForgetMe(): void
*/
function disableThirdPartySharing(): void

interface SmartBannerOptions {

/** Web token to initialise Smart Banner */
webToken: string;

/** 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.
* Here are more details about each log level:
* - `verbose` - will print detailed messages in case of certain actions
* - `info` - will print only basic info messages, warnings and errors
* - `warning` - will print only warning and error messages
* - `error` - will print only error message
* - `none` - won't print anything
*/
logLevel?: LogLevel;
}

/**
* Initiate Smart Banner.
*
* This method gets Smart Banner data and creates Smart Banner UI.
*
* @param {SmartBannerOptions} options Options to initiate Smart Banner.
*
* @example
* Adjust.initSmartBanner({
* webToken: 'YOUR_WEB_TOKEN',
* logLevel: 'verbose'
* });
*/
function initSmartBanner(options: SmartBannerOptions): void

const Adjust = {
initSdk,
trackEvent,
Expand All @@ -304,7 +338,8 @@ const Adjust = {
stop,
restart,
gdprForgetMe,
disableThirdPartySharing
disableThirdPartySharing,
initSmartBanner,
}

export default Adjust
Loading