Closed (won't fix)
Project:
Google Analytics Reports
Version:
6.x-1.x-dev
Component:
Reports module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2010 at 20:03 UTC
Updated:
1 Aug 2015 at 15:51 UTC
Jump to comment: Most recent
Comments
Comment #1
gregglesAnother idea is to store the values locally. The module could periodically get some data (like page visits) from google analytics and store those in a local database table and then add views metadata for that table so it can be used with a relationship to the node table.
Also, subscribe and I'm potentially going to work on this in the next few days.
Comment #2
rickvug commented@greggles That is certainly one approach. I wonder how well it will scale on a site with many pages that wants to have data updated daily. I'm also wondering out loud about data retention clauses for the API. Does Google say anything about storing data locally? I haven't looked into terms of use one way or another. Don't let any of these comments discourage work. Just thinking out loud here.
Comment #3
shrimphead commentedsubscribing
Comment #4
jkitching commentedJust to let everyone know, I'm planning on applying for another GSoC grant ths summer to continue development on the Google Analytics API module. Views 3 could be one of the major features written.
Comment #5
gregglesUpdating the title to refer to exactly what I need. If others want something different I should be clear.
Also, I hope to have a patch (or a new module, not sure) real soon now.
Comment #6
gregglesNevermind!
What I needed is already possible with http://drupal.org/project/ga_customvars so I'm switching this back to the much more complex (and exciting) purpose of making Google Analytics a live backend for the data.
Comment #7
grendzy commentedComment #8
achtonThis would allow for some interesting "Related Content"-type applications, AFAICT. If E-commerce data was available as well, the Ubercart/Commerce guys would probably wet their pants.
So subscribing.
Comment #9
dstolTo latch on here... much of the lift of importing GA data into Drupal has been implemented in http://drupal.org/project/ga_importer
Comment #10
grendzy commenteddstol: interesting! As we're conceptualizing it now, the views integration would be a views 3.x query plugin - so views could query GA directly.
I see there are advantages to updating the {node_counter} table, as well, so we may want both. A question, I assumed {node_counter} was "owned" by the core statistics module, but looking at the core install files this seems to be not the case? What are your thoughts?
Comment #11
jimmynail commentedsubscribing.
GA data like visits, keywords, adsense cpm available through Views would enable all kinds of great.
Comment #12
greggles@grendzy, as of a few months ago the ga_importer updates both node_counter AND its own table. The latter seems like the right thing for us to do, it just needs views integration so we can sort views by it and then we can drop the updating of node_counter.
Comment #13
dstol@grendzy, updating {node_counter} was necessary for my use case. My site sits behind Akamai so 90% of the traffic is served out of their edge. We wanted to use some of the blocks for popular content for an internal dashboard and ga_importer is what we came up with.
I'm all for dropping support for updating {node_counter} but I'd also like to a hook like
hook_google_analytics_api_incoming_data()so that other tables could be used as well.Comment #14
grendzy commentedI found this list of known query plugins, that we can use for inspiration / code samples:
http://drupal.org/node/1126578
Comment #15
grendzy commenteddstol: From #440768: Transfer the {node_counter} table from node.module, I infer that node_counter really belonged to the statistics module all along; the fact that it was previously in node.install was just an oversight.
Can you explain more about the use case for the proposed hook_google_analytics_api_incoming_data()? We are mostly expecting modules to fetch data they need with google_analytics_api_report_data().
Comment #16
2ndChanceTech commentedsubscribing
Comment #17
jameswoods commentedsubscribing
Comment #18
pixelsweatshop commentedPossible duplication of efforts? http://drupal.org/project/ga_stats
Comment #19
grendzy commentedYes, indeed it also duplicates http://drupal.org/project/google_analytics_counter and http://drupal.org/project/ga_importer .
The aim of this issue is fundamentally different, however - we hope to write a query plugin that bypasses the database entirely.
Comment #20
SWMdave commentedSubscribe-
Comment #21
ximo commentedShamelessly subscribing…
I hope this effort will be for 7.x as well?
Comment #22
SchwebDesign commentedsubscribing- i need this for Views 3 in Drupal 6... is how similar is that to the code for Views 3 in Drupal 7?.... i'm guessing different enough there'd need to be a views 2 and views 3 version for Drupal 6 or one that can handle both?
Comment #23
grendzy commentedRaspberryman has done it! Check out the 7.x-3.x branch, and the announcement on metaltoad.com.
Comment #24
Angry Dan commentedHas anyone got any ideas on how we could relate this back to the node table? It would be really interesting if we could find a way of joining the data back to node so that you could create relationships in the interface.
Comment #25
Tander1 commentedThat's great news for users of Drupal 7... any ideas if this can be done for 6 ?
Comment #26
jtbayly commented"Has anyone got any ideas on how we could relate this back to the node table?"
Yes, this is exactly what I want to know. (Because it's exactly what I need!)
-Joseph
Comment #27
gstout commentedSubscribing. Need this for Drupal 6. I've hacked together some horrible direct calls into views for this purpose but would much prefer using this new system.
Comment #28
jtbayly commentedI'm sorry it's only D7, but ga_stats provides truly useful views integration with Google Analytics, including relating the data to the node table so that the queries are actually useful. I'm quite pleased with it. Even though it is limiting in terms of what you can actually query, it is the only module that really worked for me.
I needed to produce a "most popular content" block on a server with heavy caching. The only practical way to do this is to rely on data from Google Analytics for pageviews. But ga_importer is basically abandoned now, and google_analytics_counter wasn't actually putting the statistics into the core table like it's supposed to. And google_analytics_reports allowed me to get the data, but there was no way for me to get the node title into the view for displaying on the front-end.
If that last hurdle could be overcome with this module, I think we could move this out of "needs work" but until then, I don't think views integration is really complete. Maybe somebody can take a look at how they did it in ga_stats and do that here too?
-Joseph
Comment #29
grendzy commentedjtbayly -
ga:pageTitleshould be available as a dimension in Views.Still, I've opened a new feature request for node relationships: #1742914: Support views relationship with nodes. I'd like this feature also; please understand it will be challenging because field queries use SQL, and GA queries use a REST / XML API. This approach is fundamentally different from e.g. google_analytics_counter which imports data into SQL.
I'm not sure what's up with google_analytics_counter. For reference, the issue jtbayly mentions is #1407034: The node counter does not replace the value from the statistics module.
Comment #30
jtbayly commentedThanks grendzy.
I guess a feature request is really the way to go. I didn't catch that basic difference in querying. Still, how is ga_stats doing it?
I did try using ga:pageTitle, but the title is often more than simply the node title. On my site, it goes "[node title] - [site name]" and I couldn't figure out how to remove just the sitename from the field in Views. I'm sure there's a way (there always is), but I gave up.
I'm a huge fan of how this module exposes *all* the data from ga to views. I think I'm going to be able to do very neat stuff with it in the backend, but until i can get the node too, ga_stats is working just fine for the "most popular" block.
-Joseph
Comment #31
jtbayly commentedEdited to remove comment as I put it on a different issue. See next comment.
Comment #32
jtbayly commentedsetting status back, because there is a separate issue for my patch: #1649270: Views break when custom fields are used
Comment #33
plazik commentedViews intergration is in 7.x.
6.x version is unsupported. Please upgrade to 7.x.