Skip to content

Commit ed0c6bd

Browse files
authored
Merge pull request #129 from devinmatte/develop
Google Analytics through config
2 parents 18bd35a + 8cbff62 commit ed0c6bd

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ ENV/
106106
# Configurations
107107
config.py
108108

109+
# Setup
110+
node_modules
111+
109112
# Generated Assets
110113
packet/static/css/packet.css
111114
*.min.css
@@ -124,3 +127,4 @@ packet/static/mstile-70x70.png
124127
packet/static/safari-pinned-tab.svg
125128
packet/static/site.webmanifest
126129
faviconData.json
130+

config.env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
# Logging config
1616
LOG_LEVEL = environ.get("PACKET_LOG_LEVEL", "INFO")
17+
ANALYTICS_ID = environ.get("ANALYTICS_ID", "UA-134137724-9")
1718

1819
# OpenID Connect SSO config
1920
REALM = environ.get("PACKET_REALM", "csh")

packet/templates/include/head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737

3838
<link rel="stylesheet" href="/static/css/packet.min.css">
3939

40-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-134137724-9"></script>
40+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ config['ANALYTICS_ID'] }}"></script>
4141
<script>
4242
window.dataLayer = window.dataLayer || [];
4343
function gtag(){dataLayer.push(arguments);}
4444
gtag('js', new Date());
4545
gtag('set', {'user_id': '{{ info.uid }}' });
46-
gtag('config', 'UA-134137724-9');
46+
gtag('config', '{{ config['ANALYTICS_ID'] }}');
4747
</script>
4848
</head>

0 commit comments

Comments
 (0)