I apply a Google analytics service. I got a code.

  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  ga('create', 'MY UA CODE', 'auto');
  ga('send', 'pageview');

My drupal use AT Commerce this theme. Where do I put this code to my folder's file? There is an optional method. The php is here where I want to add to my block and let it call the above script.

<?php include_once("analyticstracking.php") ?>

Do I follow the same name analyticstracking.php or just add the above script to an existed php file? Thanks.


You can install module Google Analytics. Or paste script to file html.tpl.php.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.