Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We need create a way to combine Google Analytics data and Drupal data.
Original report:
Hi,
Is it possible to add the node relationship as an option? I can imagine the node ID isn't stored in GA, but shouldn't it be possible to get the node ID via the path?
Kind regards,
Mark
Comment | File | Size | Author |
---|---|---|---|
#4 | google_analytics_reports-arguments-1837230-6.patch | 6.66 KB | dwkitchen |
#1 | 1837230.patch | 4.33 KB | grendzy |
Comments
Comment #1
grendzy CreditAttribution: grendzy commentedIt's something I've fiddled with a little. A relationship in the usual way is impossible, because there's no way to "join" GA data with SQL data in a single query. I'm trying to find a way to execute two queries and combine the results before rendering, but Views isn't really designed for this.
Non-working patch attached with my experiment so for.
If you need this functionality now, my advice is to use a theme pre-process function to load the node data, or write your reports using
google_analytics_api_report_data().
Comment #2
dwkitchen CreditAttribution: dwkitchen commentedI have also been looking for a method to do this.
What I came up with is a argument handler. All this offers is the most viewed node ids.
Add nid to the arguments and then select default value, you can now select Google Analytics in the list.
If this looks like a good way to go it can be developed further.
Comment #3
dwkitchen CreditAttribution: dwkitchen commentedHere is a new patch, you can now enter manual options for filters etc.
Comment #4
dwkitchen CreditAttribution: dwkitchen commentedUpdated version with corrections for sorting and filtering.
Comment #5
Plazik CreditAttribution: Plazik as a volunteer commentedCombined all the tasks into one.
#1742914: Support views relationship with nodes
#689138: Google Analytics for Each User?
#2603102: Analytics per Organic group
Comment #6
Plazik CreditAttribution: Plazik as a volunteer commentedComment #7
pixelsweatshop CreditAttribution: pixelsweatshop commentedLooks like there is some great work going on here. Tested against latest dev and the patch no longer applies. Looks like there was a some restructuring after this patch was made.
Comment #8
loparr CreditAttribution: loparr commentedCan anybody confirm that this patch works? What other solutions do we have regarding pulling data from analytics and using it with data from drupal? Thank you.
Comment #9
pribeh CreditAttribution: pribeh commentedHas anybody taken a stab at this again after the restructuring?
Comment #10
Libbna CreditAttribution: Libbna as a volunteer and at QED42 for Drupal India Association commentedDoes anyone have any update on this?