Running 4.7 RC1. Installed and entered google analytics user id -> UA-258XXX-2. However, view source only shows:
and Google cant verify that tracking is installed. Is it suppossed to show:
"
_uacct = "UA-258XXX-2"; urchinTracker();"
Anyway, I appreciate the help in advance.
Best,
Ivan
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | googleanalytics.rar | 917 bytes | mudanoman |
Comments
Comment #1
mudanoman commentedThis seemed to fix it:
/**
* Implementation of hook_footer()
*/
function googleanalytics_footer($main = 0) {
$id = variable_get('googleanalytics_account', '');
if($id != '') {
_uacct = "'.$id.'"; urchinTracker();drupal_set_html_head ('
');
}
}
Comment #2
mudanoman commentedThe previous post needs to be deleted.
Attached is the module file that is now working for me in 4.7 RC1. Essentially, the necessary analytics script is added to the header via "drupal_set_html_head".
Peace,
Ivan
Comment #3
buddaPlease submit changes as a patch file.
The change is not suitable though. The recent change/suggestion by Google is to place the
<script type="text/javascript">_uacct = "'.$id.'"; urchinTracker();</script>in the footer of a page. Your code is actuallt placing this in the header again!The recent change to the Drupal JS function means I cannot add JavaScript from a remote server, so I will make the required changes.
Comment #4
buddaFixed including of external JavaScript.
Committed to CVS HEAD, and DRUPAL-4-7 branch.
Comment #5
(not verified) commented