Hello!
I tried to include google analytics like that:
db.py

> response 
> <http://192.168.20.184/examples/global/vars/response>.google_analytics_id = 
> configuration.get('google.analytics_id')
>
> layout.html

> {{if response.google_analytics_id:}}
>             <script src="{{=URL('static','js/analytics.js')}}"></script>
>             <script type="text/javascript">
>                 analytics.initialize({
>                     'Google 
> Analytics':{trackingId:'{{=response.google_analytics_id}}'}
>             });</script>
> {{pass}}

 appconfig.ini

> [google]
> analytics_id = XX-XXXXXXXXX-X

and I cannot have result. If I use standart google method all work:

> <!-- Global site tag (gtag.js) - Google Analytics -->
> <script async 
> src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXXX-X";></script>
> <script>
> window.dataLayer = window.dataLayer || [];
> function gtag(){dataLayer.push(arguments);}
> gtag('js', new Date());
> gtag('config', 'XX-XXXXXXXXX-X');
> </script>

 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to