mirror of
https://github.com/slawkens/myaac.git
synced 2025-05-02 20:29:20 +02:00
Fix google_analytics
This commit is contained in:
parent
191137282b
commit
d82e3a21e5
@ -529,8 +529,8 @@ function template_footer(): string
|
|||||||
|
|
||||||
function template_ga_code()
|
function template_ga_code()
|
||||||
{
|
{
|
||||||
global $config, $twig;
|
global $twig;
|
||||||
if(!isset($config['google_analytics_id'][0]))
|
if(!isset(setting('core.google_analytics_id')[0]))
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
return $twig->render('google_analytics.html.twig');
|
return $twig->render('google_analytics.html.twig');
|
||||||
|
@ -95,7 +95,7 @@ return [
|
|||||||
'google_analytics_id' => [
|
'google_analytics_id' => [
|
||||||
'name' => 'Google Analytics ID',
|
'name' => 'Google Analytics ID',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'desc' => 'UA-XXXXXXX-X',
|
'desc' => 'Format: UA-XXXXXXX-X',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
ga('create', '{{ config.google_analytics_id }}', 'auto');
|
ga('create', '{{ setting('core.google_analytics_id') }}', 'auto');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user