Welcome to the LimeSurvey Community Forum

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

Google Analytics will never work?

  • liamh121
  • liamh121's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 6 months ago #125670 by liamh121
Google Analytics will never work? was created 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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 6 months ago #125671 by holch
Replied by holch on topic Google Analytics will never work?
What means "nothing" exactly? That Google Analytics doesn't count visits?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • gabrieljenik
  • gabrieljenik's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 6 months ago #125673 by gabrieljenik
Replied by gabrieljenik on topic Google Analytics will never work?
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
8 years 5 months ago #126061 by ryanf
Replied by ryanf on topic Google Analytics will never work?
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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 5 months ago #126065 by DenisChenu
Replied by DenisChenu on topic Google Analytics will never work?
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 service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose