Skip to content

Commit

Permalink
added google_analytics_4 script in main.html
Browse files Browse the repository at this point in the history
  • Loading branch information
zainvrk committed May 30, 2023
1 parent c60635f commit e29dd9e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mitx/lms/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,18 @@
</script>
% endif

<% ga_4_id = static.get_value("GOOGLE_ANALYTICS_4_ID", settings.GOOGLE_ANALYTICS_4_ID) %>
% if ga_4_id:
<script async src="https://www.googletagmanager.com/gtag/js?id=${ga_4_id}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '${ga_4_id | n, js_escaped_string}');
</script>
% endif

<% branch_key = static.get_value("BRANCH_IO_KEY", settings.BRANCH_IO_KEY) %>
% if branch_key and not is_from_mobile_app:
<script type="text/javascript">
Expand Down

0 comments on commit e29dd9e

Please sign in to comment.