Skip to content

Commit

Permalink
🚑 fix(gh-page): Correctly run custom script for consent UI in production
Browse files Browse the repository at this point in the history
This commit addresses an issue where the custom script for the consent UI was not running correctly in production environments due to the presence of the `data-ampdevmode` attribute.

Two new settings have been added to the site configuration according to the latest theme version 2.9.1:

- `consent_dev_mode`: This setting can be set to `false` to remove the `data-ampdevmode` attribute from the `amp-script` component, ensuring it runs correctly in production.

- `script_hash`: This setting holds the script hash for the `get_stored_consentStates` script, which is used for the consent UI. This hash is necessary for the script to run correctly.

The `data-ampdevmode` attribute has been removed from the `amp-script` component in non-development environments to ensure the script runs as expected.
  • Loading branch information
chriskyfung committed Mar 11, 2024
1 parent 98d9423 commit f0b1b1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ copyright:

# Cookie Consent Notice
consent: true
consent_dev_mode: false
script_hash:
consent_gsc: sha384-YZsyY8-Pag5BkrdKaSDSmZnCQGWcbyFYlQC0xq5mV_6kkBMuRA4Lnfjd3LEZ4ASF

defaults:
-
Expand Down

0 comments on commit f0b1b1f

Please sign in to comment.