Skip to content

Commit

Permalink
Add setPrivacySettings method to googletagservices-gpt
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamWr committed Nov 21, 2023
1 parent 804a596 commit 9244d6d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- TODO: add @added tag to the files with specific version -->
<!-- during new scriptlets or redirects releasing -->

## [Unreleased]

### Added

- `setPrivacySettings()` method to `googletagservices-gpt` redirect
[#344](https://github.com/AdguardTeam/Scriptlets/issues/344)


## [v1.9.96] - 2023-11-15

### Added
Expand Down Expand Up @@ -292,6 +300,7 @@ prevent inline `onerror` and match `link` tag [#276](https://github.com/AdguardT
- `metrika-yandex-tag` [#254](https://github.com/AdguardTeam/Scriptlets/issues/254)
- `googlesyndication-adsbygoogle` [#252](https://github.com/AdguardTeam/Scriptlets/issues/252)

[Unreleased]: https://github.com/AdguardTeam/Scriptlets/compare/v1.9.96...HEAD
[v1.9.96]: https://github.com/AdguardTeam/Scriptlets/compare/v1.9.91...v1.9.96
[v1.9.91]: https://github.com/AdguardTeam/Scriptlets/compare/v1.9.83...v1.9.91
[v1.9.83]: https://github.com/AdguardTeam/Scriptlets/compare/v1.9.72...v1.9.83
Expand Down
1 change: 1 addition & 0 deletions src/redirects/googletagservices-gpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export function GoogleTagServicesGpt(source) {
setCookieOptions: noopThis,
setForceSafeFrame: noopThis,
setLocation: noopThis,
setPrivacySettings: noopThis,
setPublisherProvidedId: noopThis,
setRequestNonPersonalizedAds: noopThis,
setSafeFrameConfig: noopThis,
Expand Down
9 changes: 9 additions & 0 deletions tests/redirects/googletagservices-gpt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,12 @@ test('Test updateTargetingFromMap', (assert) => {
);
assert.strictEqual(window.hit, 'FIRED', 'hit function was executed');
});

test('Test setPrivacySettings', (assert) => {
runRedirect(name);

const setPrivacySettings = window.googletag.pubads().setPrivacySettings({});
assert.ok(window.googletag, 'window.googletag have been created');
assert.strictEqual(typeof setPrivacySettings, 'object', 'setPrivacySettings has been mocked');
assert.strictEqual(window.hit, 'FIRED', 'hit function was executed');
});

0 comments on commit 9244d6d

Please sign in to comment.