cookiebot-js.php
3 years ago
google-consent-mode-js.php
3 years ago
google-tag-manager-js.php
4 years ago
google-consent-mode-js.php
28 lines
| 1 | <?php |
| 2 | /** @var string $data_layer */ |
| 3 | |
| 4 | $is_url_passthrough_enabled = '1' === (string) get_option( 'cookiebot-gcm-url-passthrough', 1 ); |
| 5 | |
| 6 | ?> |
| 7 | <script data-cookieconsent="ignore"> |
| 8 | window.<?php echo esc_js( $data_layer ); ?> = window.<?php echo esc_js( $data_layer ); ?> || []; |
| 9 | function gtag() { |
| 10 | dataLayer.push(arguments); |
| 11 | } |
| 12 | gtag("consent", "default", { |
| 13 | ad_storage: "denied", |
| 14 | analytics_storage: "denied", |
| 15 | functionality_storage: "denied", |
| 16 | personalization_storage: "denied", |
| 17 | security_storage: "granted", |
| 18 | wait_for_update: 500, |
| 19 | }); |
| 20 | gtag("set", "ads_data_redaction", true); |
| 21 | <?php |
| 22 | if ( $is_url_passthrough_enabled ) { |
| 23 | echo /** @lang JavaScript */ |
| 24 | 'gtag("set", "url_passthrough", true);' . PHP_EOL; |
| 25 | } |
| 26 | ?> |
| 27 | </script> |
| 28 |