Skip to content

Commit

Permalink
Updated GA4
Browse files Browse the repository at this point in the history
  • Loading branch information
desafinadude committed Aug 14, 2023
1 parent 05c00d2 commit 8043e6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
5 changes: 4 additions & 1 deletion pombola/settings/south_africa.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
PIPELINE['STYLESHEETS'].update(COUNTRY_CSS)
PIPELINE['JAVASCRIPT'].update(COUNTRY_JS)

EXCLUDE_FROM_SEARCH = ('places', 'info_pages');
EXCLUDE_FROM_SEARCH = ('places', 'info_pages')

pmg_api_cache_dir = os.environ.get('PMG_API_CACHE_DIR', 'pmg_api_cache')
PMG_API_CACHE_PATH = os.path.join(data_dir, pmg_api_cache_dir)
Expand All @@ -44,3 +44,6 @@
},
'TIMEOUT': 60*60*24,
}


GOOGLE_ANALYTICS_ID = 'G-RK0Z57HMF6'
17 changes: 7 additions & 10 deletions pombola/templates/default_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,14 @@
crosshairs_image: '{% static 'images/crosshairs.png' %}',
google_recaptcha_site_key: '{{ settings.GOOGLE_RECAPTCHA_SITE_KEY }}'
};

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', pombola_settings.google_analytics_account);
ga('send', 'pageview');
</script>
<script type="text/javascript" async
src="//l.getsitecontrol.com/94g06o07.js">
<script async src="https://www.googletagmanager.com/gtag/js?id={{ settings.GOOGLE_ANALYTICS_ID }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ settings.GOOGLE_ANALYTICS_ID }}');
</script>

{% load pipeline %}
Expand Down

0 comments on commit 8043e6a

Please sign in to comment.