PluginProbe
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / 4.7.4
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode v4.7.4
4.7.4 4.7.5 4.7.3 4.7.2 4.7.1 trunk 2.3.0 2.4.0 2.4.1 2.4.2 2.5.0 3.0.0 3.0.1 3.1.0 3.10.0 3.10.1 3.11.1 3.11.2 3.11.3 3.2.0 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 All 95 releases
cookiebot / src / view / frontend / scripts / common / google-consent-mode-js.php

google-consent-mode-js.php in Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode 4.7.4, at src/view/frontend/scripts/common/google-consent-mode-js.php

35 lines 936 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @var string $data_layer
4 * @var string $url_passthrough
5 * @var bool|string $consent_attribute
6 * @var string $script_type
7 */
8
9 ?>
10 <script type="<?php echo esc_attr( $script_type ); ?>"<?php echo ! $consent_attribute ? '' : ' data-cookieconsent="' . esc_attr( $consent_attribute ) . '"'; ?>>
11 window.<?php echo esc_js( $data_layer ); ?> = window.<?php echo esc_js( $data_layer ); ?> || [];
12
13 function gtag() {
14 <?php echo esc_js( $data_layer ); ?>.push(arguments);
15 }
16
17 gtag("consent", "default", {
18 ad_personalization: "denied",
19 ad_storage: "denied",
20 ad_user_data: "denied",
21 analytics_storage: "denied",
22 functionality_storage: "denied",
23 personalization_storage: "denied",
24 security_storage: "granted",
25 wait_for_update: 500,
26 });
27 gtag("set", "ads_data_redaction", true);
28 <?php
29 if ( $url_passthrough ) {
30 echo /** @lang JavaScript */
31 'gtag("set", "url_passthrough", true);' . PHP_EOL;
32 }
33 ?>
34 </script>
35