Skip to content

Commit 3baf435

Browse files
committed
Move website to Umami from Google Analytics
1 parent f1953c7 commit 3baf435

6 files changed

Lines changed: 7 additions & 188 deletions

File tree

.github/workflows/baseline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ jobs:
242242
SCHEME: https
243243
DOMAIN: flow-php.com
244244
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
245-
GOOGLE_ANALYTICS_ID: '${{ vars.GOOGLE_ANALYTICS_ID }}'
245+
GOOGLE_ANALYTICS_ID: '${{ vars.UMAMI_ID }}'
246246
FLOW_VERSION: ${{ steps.flow_version.outputs.tag }}
247247
working-directory: "web/landing"
248248

web/landing/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ APP_SECRET=04f48bdb7d5426b4c5ba6aaf3d00a1fa
33
SCHEME='https'
44
DOMAIN='flow-php.wip'
55
GITHUB_TOKEN=changeme
6-
GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX
6+
UMAMI_ID=
77
FLOW_VERSION=1.x-dev

web/landing/assets/controllers/cookie_consent_controller.js

Lines changed: 0 additions & 108 deletions
This file was deleted.

web/landing/assets/controllers/cookie_fallback_controller.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

web/landing/config/packages/twig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
twig:
22
default_path: '%kernel.project_dir%/templates'
33
globals:
4-
google_analytics_id: '%env(GOOGLE_ANALYTICS_ID)%'
4+
umami_id: '%env(UMAMI_ID)%'
55
flow_version: '%flow_version%'
66
when@test:
77
twig:

web/landing/templates/base.html.twig

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,10 @@
3737
{% endblock %}
3838

3939
{% block tracking %}
40-
<script>
41-
window.dataLayer = window.dataLayer || [];
42-
function gtag() {
43-
dataLayer.push(arguments);
44-
}
45-
gtag("consent", "default", {
46-
ad_user_data: 'denied',
47-
ad_personalization: 'denied',
48-
ad_storage: 'denied',
49-
analytics_storage: 'denied'
50-
});
51-
gtag('config', '{{ google_analytics_id }}');
52-
</script>
40+
{% if umami_id|length %}
41+
<script defer src="https://cloud.umami.is/script.js" data-website-id="{{ umami_id }}"></script>
42+
{% endif %}
43+
{{ importmap() }}
5344
{% endblock %}
5445

5546
{% block javascripts %}
@@ -153,45 +144,5 @@
153144
<a href="https://github.com/flow-php">&copy; Copyright {{ 'now' | date('Y') }} Flow PHP</a>
154145
</div>
155146
</footer>
156-
157-
<div data-controller="cookie-consent" data-cookie-consent-ga-id-value="{{ google_analytics_id }}">
158-
<div data-cookie-consent-target="banner"
159-
class="border-t-4 border-orange-100 hidden fixed bottom-0 left-0 w-full bg-black text-white text-lg p-5 flex flex-col items-center justify-center space-y-2 md:space-y-0 md:flex-row md:justify-between z-50"
160-
>
161-
<span>
162-
Oops, sorry we have to ask this—but we need your okay to use cookies for page view stats. <br/>
163-
It helps us improve this open-source project and keep it awesome!<br/>
164-
Care to help out?
165-
</span>
166-
<span data-cookie-consent-target="status">Status: Undecided</span>
167-
168-
<div class="flex space-x-4 mt-2 md:mt-0">
169-
<button
170-
type="button"
171-
class="bg-blue-100 hover:bg-blue-200 text-white px-4 py-2 rounded ml-4"
172-
data-action="click->cookie-consent#accept"
173-
>
174-
Accept All
175-
</button>
176-
<button
177-
type="button"
178-
class="border border-blue-100 hover:border-blue-200 text-white px-4 py-2 rounded"
179-
data-action="click->cookie-consent#reject"
180-
>
181-
Reject All
182-
</button>
183-
</div>
184-
</div>
185-
186-
<div class="fixed bottom-4 left-4 bg-orange-100 rounded-md shadow hidden" data-cookie-consent-target="button">
187-
<button
188-
type="button"
189-
class="fixed bottom-4 left-4 bg-orange-100 text-white p-2 rounded-full shadow-lg hover:bg-orange-200 focus:outline-none focus:ring-2 focus:ring-orange-100 focus:ring-opacity-50"
190-
data-action="click->cookie-consent#showBanner"
191-
>
192-
<img src="{{ asset('images/icons/cookie.svg') }}" width="32" height="32" alt="scroll back to top" class="inline text-black">
193-
</button>
194-
</div>
195-
</div>
196147
</body>
197148
</html>

0 commit comments

Comments
 (0)