It is fine if you want to put the snippet in the page.tpl.php file. You will basically benefit Google Analytics module's conditional-snippet features.
If you put the snippet in page.tpl.php file,
Admin theme will not be tracked (which is usually Seven, which is in core - don't hack core!)
Users cannot opt-put for tracking (See your drupal.org account ...
A bad implementation of your code is causing the confusion. The input data is not stored in the $form_state variable, but in $form_state['input'] initially.
Once the user submit a form, Drupal will build the form again and process the values. In this step, the system make some checks. You can take a look of functions that have been called.
There is an officially released module (since early 2014): GoogleTagManager.
Allow the non-technical stakeholders to manage the analytics for their website using the Google Tag Manager (GTM). This module allows you to trigger the insertion of tags and tracking systems onto the pages of the site.
Easiest and most admin-friendly way is to use Google Analytics module:
Adds the Google Analytics web statistics tracking system to your website.
Just install it, turn it on and configure.
To add google analytics to every theme,some manual work is required as:-
In your theme's folder ,
select a theme in which you want to add google analytics
open the theme folder and then create a folder for js files
create a js file and include the code provided to you by google for google analytics.
save the file and this way google analytics is installed ...
Drupal have the Google Analytics too
Adds the Google Analytics web statistics tracking system to your
also install the Google Analytics Reports module to track within the site itself.
Google Analytics Reports provides graphical reporting of your site's
tracking data. Graphical reports include a dashboard widget for
admins, a small path-...
Google Analytics Statistics has integration with views...
Project page says
This module provides views integration for the Google Analytics Data
This allows you to use Google Analytics directly through views to do
things like Most Popular, Most Read ect. You can combine the
statistics to create interesting results.
You will need to install the module on each site using the same UA# (assuming these should all be tracked under the same account).
All you need to do is select One domain with multiple subdomains for everything to track properly.
I checked the error log and when I try to uninstall I get the following error PHP Fatal error: Call to undefined function google_analytics_clear_js_cache()
This means that there is a bug in this module (and off-topic here).
But this is a general problem, and this anser provides is a general solution to this problem, that can also be used with other ...
You may want to use the Flag, Rules and Views modules, as further detailed below ...
Enable the Flag module, and create a global flag which you label something like "Visited by an anonymous user".
That way, later on, any node that is NOT flagged by this flag, is one of the nodes that your question is about.
Enable the Rules module, and ...
Seems to me that Google Analytics Reports is the solution for this, no? Those "reports" do include charts also (not just tabular data).
If you rather want to create some charts yourself, consider the Comparison of Charting Modules as a possible place to do start from, to find the module that best fits your needs. Possible alternatives that might work for ...
You might be interested in:
This module provides a way to serve DoubleClick's Google Publisher Tag
(GPT) (Premium and Small Business) ads on Drupal.
Benefits of GPT
The new Google Publisher Tags have multiple benefits over Google Ad
Manager (GAM) tags and the legacy DoubleClick for Publishers Dart
What method are you using to Push? Configuring the rule, you can select it at the bottom of the edit page:
I just tried it with Analytics.js support and the checkout page appears to display the Analytics code:
var ga = ga || ;
ga('require', 'ecommerce', 'ecommerce.js');
First of all this is not a Drupal Question, but anyways.
You can see Google Analytics for Anonymous users in your Google webmasters dashboard. Drupal has nothing to do with this.
Drupal Module for Google Analytics has only one function - Tell Google that it's your website and track its activities. Google does the real work of tracking.
I would like to offer an alternative. I have always had issues with putting my analytics into the analytics module. I have experienced what you have experienced, plus I question why this code has to go into a module? The fewer modules you have the faster your site performs.
I always get the code from Google and then hard code it into the theme files. In ...
"Custom variables" are now Custom dimensions and metrics.
The Google Analytics module supports custom dimensions and metrics.
See the module's README.txt:
One example for custom dimensions tracking is the "User roles" tracking.
In the Google Analytics Management Interface you need to setup Dimension #1 with name e.g. "User roles". This step ...
Try Google Analytics Reports module.
Graphical reports include a dashboard widget for admins, a small
path-based report in blocks, and a full path-based report.
Prerequisites are the Google Charts API module and the OAth
module. Do not forget to set the module’s permissions about who has
access to the reports.
I think the module serves well, but if you don't want to use the module for some reason, you can always create a new block and copy/paste the code provided by Google Analytics in there. Make sure you select the Text Format as Full HTML or similar which doesn't strip out <script> tags.
And of course, enable the block and move it to a footer region.
I think I found this solution on those 3 articles:
i hope this helps someone.
You can consider using Drupal Most Popular Module
The module is pre-packaged with several services including: Google
Analytics - Most Viewed pages
Create any number of Most Popular widget blocks, displaying any combination of services and intervals.
Customize the maximum number of results to display for each block.
Show or hide the number of ...
There's a module called Google Analytics Counter. This is from its project page:
Views integration with any of the storage tables. If using the module's table, to add the counter values for nodes to your view you
just need to add field "Pageview Total". Sorting and filtering by the
counter values works as well. This for example allows you to show
The GA Event Tracking module is designed to react to a number of different binded JS events. You're limited by what DOM events that jQuery can bind to. As such, there is no settimeout event.
I finally found the way of add this event code in google analytics module.
Go to your admin->configs->google analytics
Then in the field Code snippet (after)
add this snipppet:
setTimeout(“ga(‘send’,’event’,’Profitable Engagement’,’time on page more than 3 minutes’)”, 180000);
I modified ...
The answer of the question depending on how you want to track each website in GA.
First off, since you have multiple configurations/databases, you'll need to setup GA (@ /admin/config/system/googleanalytics) on each the site if you're wanting to track each one, regardless how you track the sites in GA.
Next, if you're wanting to track each site separately ...