client/src/MobicoopBundle/Resources/views/googleAnalyticsHome.html.twig
<script>
/* /!\ Without consent, we dont send any informations */
let cookiesPrefsGAHome = JSON.parse(localStorage.getItem('cookies_prefs'));
let sendStatsGAHome = (cookiesPrefsGAHome && cookiesPrefsGAHome.stats)
if(sendStatsGAHome){
gtag('event', 'conversion', {
'allow_custom_scripts': true,
'send_to': '{{ googleAnalyticsId }}{{ googleAnalyticsHome }}'
});
}
</script>
<noscript>
<img src="{{ googleAnalyticsHomeSource }}" width="1" height="1" alt=""/>
</noscript>