Skip to content

Commit

Permalink
Update Consent Mode script and webpack based on approved IB.
Browse files Browse the repository at this point in the history
  • Loading branch information
benbowler committed Jul 2, 2024
1 parent e89e704 commit 0b568a3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 88 deletions.
3 changes: 3 additions & 0 deletions includes/Core/Consent_Mode/Consent_Mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ protected function render_gtag_consent_data_layer_snippet() {
'marketing' => array( 'ad_storage', 'ad_user_data', 'ad_personalization' ),
)
);

// The core Consent Mode code is in assets/js/consent-mode/consent-mode.js.
// Only code that passes data from PHP to JS should be in this file.
?>
<!-- <?php echo esc_html__( 'Google tag (gtag.js) Consent Mode dataLayer added by Site Kit', 'google-site-kit' ); ?> -->
<script id='google_gtagjs-js-consent-mode-data-layer'>
Expand Down
4 changes: 0 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const basicModulesConfig = require( './webpack/basicModules.config' );
const conversionEventProviders = require( './webpack/conversionEventProviders.config' );
const modulesConfig = require( './webpack/modules.config' );
const testBundleConfig = require( './webpack/testBundle.config' );
const consentModeConfig = require( './webpack/consentMode.config' );

function* webpackConfig( env, argv ) {
const { mode } = argv;
Expand All @@ -46,9 +45,6 @@ function* webpackConfig( env, argv ) {
// Build conversion event provider files.
yield conversionEventProviders( mode );

// Build consent mode frontend script.
yield consentModeConfig( mode );

// Build the main plugin admin css.
yield adminCssConfig( mode );
}
Expand Down
2 changes: 2 additions & 0 deletions webpack/basicModules.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ module.exports = ( mode ) => ( {
// Analytics advanced tracking script to be injected in the frontend.
'analytics-advanced-tracking':
'./assets/js/analytics-advanced-tracking.js',
// Consent Mode script.
'consent-mode': './assets/js/consent-mode/consent-mode.js',
},
externals,
output: {
Expand Down
84 changes: 0 additions & 84 deletions webpack/consentMode.config.js

This file was deleted.

0 comments on commit 0b568a3

Please sign in to comment.