Repository navigation
Add a consent banner and the conversion of a completed check - #36
Merged
Merged
Conversation
- With GOOGLE_ADS_ID set, the start page embeds /consent.js: a banner with Decline and Accept alike, Google Consent Mode v2 in basic mode, and after Accept only gtag.js for the ID, without a config command, without ad personalisation and without analytics. The choice is kept for twelve months; "Cookie settings" in the footer opens the banner again, and declining after accepting deletes the _gcl_ and _gac_ cookies. Adapted from the consent script of the DPP Service. - A completed check sends one conversion (GOOGLE_ADS_LABEL_LINTER_CHECK). It reports the address of the start page with its ad click identifier but without the product identifier, and only the origin of the referrer; the result is not sent. The start page keeps the click identifier in its address when it adds the product identifier, so that the conversion can be attributed without help from the server. - Without GOOGLE_ADS_ID nothing of this is on the page. The manifest sets the label and an empty ID. - The API documentation no longer loads web fonts from Google. - The footer links the privacy policy of the DPP services. - Tests: server side in test/integration/consent_test.rb, the click identifiers in test/javascript/click_ids.test.js, and a browser check in test/browser/consent_check.mjs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OwnYourData advertises the DPP Linter with Google Ads. This pull request adds a consent banner and one conversion, "check completed", with the same rules as on the DPP Service. Without
GOOGLE_ADS_IDnothing of it is active; the manifest sets the label and leaves the ID empty, so this deployment changes only the footer and the API documentation.Consent and tag
localStoragefor twelve months; "Cookie settings" in the footer opens the banner again; declining after accepting deletes the_gcl_and_gac_cookies on the host and its parent domains.ad_storageandad_user_datagranted,ad_personalizationandanalytics_storagedenied), ad personalisation signals off, onlygtag.jsfor the ID, nogtag("config"), no analytics, no remarketing, no enhanced conversions.app/javascript/consent.jsis adapted from the consent script of the DPP Service (OwnYourData/dpp-service-public, Apache License 2.0).Conversion
gclid,gbraid,wbraid) but without the product identifier, and only the origin of the referrer. The result is not sent.?productId=…when a check started, which dropped the click identifier before the conversion. It now keeps the click identifiers next to the product identifier, so that a tag withoutconfigcan attribute the conversion; nothing goes through the server.Also
fonts.googleapis.com; the rswag-ui template is now overridden without them.Checks
test/integration/consent_test.rb,test/integration/api_docs_test.rb,test/javascript/click_ids.test.js.test/browser/consent_check.mjsagainst a local instance, with requests to Google blocked: no request to Google before a choice on the start page, result pages, a page whose check cannot be run, the API documentation and an unknown path; after Accept onlygtag/js?id=AW-…; one conversion with the label after a check, without the product identifier; withdrawal works. With the tag loaded and only the conversion requests blocked, the request the tag would send carries the click identifier and no product identifier. Light and dark at 375 and 1280 px without horizontal scrolling. Without an ID: no banner, no cookie settings, no request to Google.