Skip to content

Commit

Permalink
Merge pull request #30 from gradle/analytics-consent
Browse files Browse the repository at this point in the history
Add a consent test for the unified form
  • Loading branch information
oleg-nenashev authored Dec 20, 2024
2 parents 848cc39 + 83c10ed commit cf8d4c5
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 22 deletions.
15 changes: 0 additions & 15 deletions docs/assets/js/google-tag-support.js

This file was deleted.

8 changes: 8 additions & 0 deletions docs/cookie-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Gradle Cookbook - Cookie Test
template: consent-test.html
---

Hello, world!
And congrats, you found a special page where we test cookies!

2 changes: 0 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ theme:

extra_css:
- assets/css/gradle.css
extra_javascript:
- assets/js/google-tag-support.js

extra:
social:
Expand Down
21 changes: 21 additions & 0 deletions overrides/consent-test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% extends "base.html" %}

{% block announce %}
Join us for <a href="https://community.gradle.org/events/hacktoberfest/2024/">Hacktoberfest 2024</a>!
{% endblock %}

{% block scripts %}
{{ super() }}

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WRTQKGT"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endblock %}

{% block footer %}
<!-- Cookie Consent -->
<div id="analytics-consent-div"></div>

{{ super() }}
{% endblock %}
3 changes: 3 additions & 0 deletions overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ <h1>Gradle Cookbook</h1>
{% block content %}{% endblock %}
{% block footer %}
<div class="md-footer-meta md-typeset">
<!-- Cookie Consent -->
<!-- FIXME: <div id="analytics-consent-div"></div> -->

<div class="md-footer-meta__inner md-grid">
{% include "partials/copyright.html" %}

Expand Down
7 changes: 7 additions & 0 deletions overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endblock %}

{% block footer %}
<!-- Cookie Consent -->
<!-- FIXME: <div id="analytics-consent-div"></div> -->

{{ super() }}
{% endblock %}
9 changes: 4 additions & 5 deletions overrides/partials/integrations/analytics/custom.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WRTQKGT');
<link rel="stylesheet" href="https://gradle.org/lib/cookie-consent-banner.css">
<script id="bt-google-tag-manager-injector" src="https://gradle.org/js/google-tag-analytics.js"
consentHolderLocator="#analytics-consent-div"
promo_location="community-site">
</script>
<!-- End Google Tag Manager -->

0 comments on commit cf8d4c5

Please sign in to comment.