Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Google Analytics will never work?

More
9 years 11 months ago #125670 by liamh121
Hi all,
Completed all the steps and we've never been able to get GA to work. Any ideas? We are using a custom template so I add the call script into start page. Still nothing. Link .

Thanks,

Liam
The topic has been locked.
More
9 years 11 months ago #125671 by holch
What means "nothing" exactly? That Google Analytics doesn't count visits?

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
9 years 11 months ago #125673 by gabrieljenik
I have seen there are some errors that make JS crash:

636898:17 Uncaught SyntaxError: Unexpected token ,
template.js:1 Uncaught SyntaxError: Unexpected token <

I suggest to review the changes done in the template.

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .

The topic has been locked.
More
9 years 11 months ago #126061 by ryanf
I kept getting the "Unexpected token <" error when {GOOGLE_ANALYTICS_JAVASCRIPT} was used. Tried a variety of solutions, none worked.

Added this to template.js and tracking now works. Change the XXXXX to your GA account ID.

(function(i,s,o,g,r,a,m){i=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', 'UA-XXXXX-X', 'auto');
ga('send', 'pageview');
The topic has been locked.
More
9 years 11 months ago #126065 by DenisChenu
Hi,

Try this in your config.php file:
Code:
some text
    'urlManager' => array(
      [Your config]
    ),
    'clientScript'=>array(
      'combineJs'=>false,
    ),
  ),
  // Use the following config variable to set modified optional settings copied from config-defaults.php
  'config'=>array(
etc ...

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose