Skip to content

Commit

Permalink
AG-17893 Add googletagmanager-gtm to compatibility-redirect #260
Browse files Browse the repository at this point in the history
Merge in ADGUARD-FILTERS/scriptlets from fix/AG-17893 to release/v1.8

Squashed commit of the following:

commit 38f3103
Author: Stanislav A <s.atroschenko@adguard.com>
Date:   Fri Dec 16 15:59:23 2022 +0300

    Add googletagmanager-gtm to compatibility-redirect
  • Loading branch information
stanislav-atr committed Dec 16, 2022
1 parent 4a030ea commit 7fd04c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/helpers/compatibility-redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ const redirects = [
adg: 'googletagmanager-gtm',
ubo: 'google-analytics_ga.js',
},
{
// https://github.com/AdguardTeam/Scriptlets/issues/260
adg: 'googletagmanager-gtm',
ubo: 'googletagmanager_gtm.js',
},
{
adg: 'googletagservices-gpt',
ubo: 'googletagservices_gpt.js',
Expand Down
4 changes: 4 additions & 0 deletions tests/lib-tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ test('Test REDIRECT-RULE converting - UBO -> ADG', (assert) => {
uboRule = '||googlesyndication.com^$script,redirect-rule=googlesyndication_adsbygoogle.js,domain=darmowa-tv.ws';
expectedAdgRule = '||googlesyndication.com^$script,redirect-rule=googlesyndication-adsbygoogle,domain=darmowa-tv.ws';
assert.strictEqual(convertRedirectToAdg(uboRule), expectedAdgRule);

uboRule = '||googletagmanager.com/gtag/js$script,redirect-rule=googletagmanager_gtm.js';
expectedAdgRule = '||googletagmanager.com/gtag/js$script,redirect-rule=googletagmanager-gtm';
assert.strictEqual(convertRedirectToAdg(uboRule), expectedAdgRule);
});

test('Test REDIRECT converting - ABP -> ADG', (assert) => {
Expand Down

0 comments on commit 7fd04c9

Please sign in to comment.