Skip to content

Commit

Permalink
small tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoestner committed Nov 21, 2024
1 parent 9c3e049 commit cd9906a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions folioflex/dashboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,19 @@
# adding shortcut icons and google analytics
GOOGLE_ANALYTICS_ID = config_helper.GOOGLE_ANALYTICS_ID
if GOOGLE_ANALYTICS_ID:
analytics_script = f"""
<script async src="https://www.googletagmanager.com/gtag/js?id={GOOGLE_ANALYTICS_ID}"></script>
analytics_script = (
f"""
<script async src="https://www.googletagmanager.com/gtag/js?id={GOOGLE_ANALYTICS_ID}"></script>""" # noqa: ISC003
+ """
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){{{{dataLayer.push(arguments);}}}}
gtag('js', new Date());
gtag('js', new Date());"""
+ f"""
gtag('config', '{GOOGLE_ANALYTICS_ID}');
</script>
"""
)
else:
analytics_script = ""

Expand Down

0 comments on commit cd9906a

Please sign in to comment.