Replace google analytics with google tag manager
This commit is contained in:
parent
ed8c62f4bd
commit
85a2a2a4a7
@ -2,7 +2,7 @@
|
|||||||
# Copy this file to .env file for development, create environment variables when deploying to production
|
# Copy this file to .env file for development, create environment variables when deploying to production
|
||||||
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
|
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
|
||||||
|
|
||||||
GOOGLE_ANALYTICS=
|
GTM_TAG=
|
||||||
|
|
||||||
###> symfony/framework-bundle ###
|
###> symfony/framework-bundle ###
|
||||||
APP_ENV=dev
|
APP_ENV=dev
|
||||||
|
@ -3,4 +3,4 @@ twig:
|
|||||||
debug: '%kernel.debug%'
|
debug: '%kernel.debug%'
|
||||||
strict_variables: '%kernel.debug%'
|
strict_variables: '%kernel.debug%'
|
||||||
globals:
|
globals:
|
||||||
ga_tracking: "%env(GOOGLE_ANALYTICS)%"
|
gtm_tracking: "%env(GTM_TAG)%"
|
||||||
|
@ -21,7 +21,7 @@ server {
|
|||||||
|
|
||||||
fastcgi_param APP_ENV "dev";
|
fastcgi_param APP_ENV "dev";
|
||||||
fastcgi_param DATABASE_URL "sqlite:///%kernel.project_dir%/var/app.db";
|
fastcgi_param DATABASE_URL "sqlite:///%kernel.project_dir%/var/app.db";
|
||||||
fastcgi_param GOOGLE_ANALYTICS "UA-00000-00";
|
fastcgi_param GTM_TAG "GTM-00000";
|
||||||
|
|
||||||
internal;
|
internal;
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,10 @@ $grid-gutter-width: $spacer * 2;
|
|||||||
|
|
||||||
@import "page/provider-picker";
|
@import "page/provider-picker";
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
overscroll-behavior-y: contain;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -23,20 +23,24 @@
|
|||||||
|
|
||||||
<title>{% block title %}Co Jedzie?{% endblock %}</title>
|
<title>{% block title %}Co Jedzie?{% endblock %}</title>
|
||||||
|
|
||||||
{% if ga_tracking %}
|
{% if gtm_tracking %}
|
||||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
<!-- Google Tag Manager -->
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ ga_tracking }}"></script>
|
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||||
<script>
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||||
window.dataLayer = window.dataLayer || [];
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||||
function gtag(){dataLayer.push(arguments);}
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||||
|
})(window,document,'script','dataLayer','{{ gtm_tracking }}');</script>
|
||||||
gtag('js', new Date());
|
<!-- End Google Tag Manager -->
|
||||||
gtag('config', '{{ ga_tracking }}');
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
|
{% if gtm_tracking %}
|
||||||
|
<!-- Google Tag Manager (noscript) -->
|
||||||
|
<iframe src="https://www.googletagmanager.com/ns.html?id={{ gtm_tracking }}"
|
||||||
|
height="0" width="0" style="display:none;visibility:hidden"></iframe>
|
||||||
|
<!-- End Google Tag Manager (noscript) -->
|
||||||
|
{% endif %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
Aplikacja wymaga do działania obsługi JavaScriptu.
|
Aplikacja wymaga do działania obsługi JavaScriptu.
|
||||||
|
Loading…
Reference in New Issue
Block a user