Skip to content

Commit

Permalink
Fix gtag undefined if not activated
Browse files Browse the repository at this point in the history
  • Loading branch information
smdsgn committed Sep 20, 2024
1 parent 35977bf commit cb049c4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions project/templates/project/pages/splash_screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ <h1 class="mb-5 fw-bold text-center">Votre diagnostic est en cours de préparati

{% block tagging %}
<script language="javascript" nonce="[NONCE_PLACEHOLDER]">
$( window ).on('load', function () {
// Google adwords
gtag('event', 'conversion', {
'send_to': 'AW-11157347812/iZaJCM7iz6kYEOS7nsgp',
'value': 5.0,
});
})
window.onload = function() {
if (typeof gtag !== 'undefined') {
// Google adwords
gtag('event', 'conversion', {
'send_to': 'AW-11157347812/iZaJCM7iz6kYEOS7nsgp',
'value': 5.0,
});
}
}
</script>
{% endblock tagging %}

0 comments on commit cb049c4

Please sign in to comment.