diff --git a/.env.dist b/.env.dist index ffec0ad..d317ecc 100644 --- a/.env.dist +++ b/.env.dist @@ -2,6 +2,8 @@ # 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 +GOOGLE_ANALYTICS= + ###> symfony/framework-bundle ### APP_ENV=dev APP_SECRET=1bdf86cdc78fba654e4f2c309c6bbdbd diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 3b315dc..95f2509 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -2,3 +2,5 @@ twig: paths: ['%kernel.project_dir%/templates'] debug: '%kernel.debug%' strict_variables: '%kernel.debug%' + globals: + ga_tracking: "%env(GOOGLE_ANALYTICS)%" diff --git a/templates/base.html.twig b/templates/base.html.twig index 9b6be8b..734326c 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -19,6 +19,18 @@