Skip to content

Commit

Permalink
Added google converstion tag for landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Jul 9, 2024
1 parent 9d4716f commit e4b84b3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
DOMAIN: flow-php.com
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GOOGLE_ANALYTICS_ID: '${{ vars.GOOGLE_ANALYTICS_ID }}'
GOOGLE_CONVERSION_TAG: '${{ vars.GOOGLE_CONVERSION_TAG }}'
working-directory: "web/landing"

- name: Pushes build to website repository
Expand Down
1 change: 1 addition & 0 deletions web/landing/.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ SCHEME='https'
DOMAIN='flow-php.wip'
GITHUB_TOKEN=changeme
GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX
GOOGLE_CONVERSION_TAG=AW-XXXXXXXXXX
2 changes: 1 addition & 1 deletion web/landing/config/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ twig:
default_path: '%kernel.project_dir%/templates'
globals:
google_analytics_id: '%env(GOOGLE_ANALYTICS_ID)%'

google_conversion_tag: '%env(GOOGLE_CONVERSION_TAG)%'
when@test:
twig:
strict_variables: true
2 changes: 1 addition & 1 deletion web/landing/templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{{ importmap() }}
{% endblock %}
</head>
<script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics_id }}"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics_id }}">gtag('config', '{{ google_conversion_tag }}');</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
Expand Down

0 comments on commit e4b84b3

Please sign in to comment.