Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
It seems after looking at my own html output and scouring over ubercart documentation, that there is no setup for Google Checkout completed purchases to be reported in Google Analytics. The essential code required for this as described in the Using Google Analytics to Track Google Checkout Orders article does not exist on the 'cart' page.
I am selling digital content which has no checkout completion page beyond the GC completion page. This may have a role in it.
Comment | File | Size | Author |
---|---|---|---|
#9 | 371788_gco_analytics.patch | 2.73 KB | Island Usurper |
#6 | analytics.patch | 1.67 KB | Island Usurper |
#2 | analytics.patch | 1.67 KB | Island Usurper |
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedDid you install the separate google analytics module?
Comment #2
Island Usurper CreditAttribution: Island Usurper commentedLooks simple enough. The google analytics module will be required to add the scripts to the cart page, so all this patch does is add the form element to the Google Checkout form.
From what I can tell, that's all that needs to happen besides sending the data with the Checkout Request.
Comment #3
clevername CreditAttribution: clevername commentedGreat, I've applied the patch and will let you know if it's working once I get some GC checkouts completed.
One other thing: Is the additional ga_post.js JavaScript call not required on the cart page with how ubercart handles functions, or will I still need to implement this?
Comment #4
Island Usurper CreditAttribution: Island Usurper commentedI don't think it needs to be, since uc_google_checkout does server-to-server checkout requests. That's very fortunate, since I couldn't find a way to add an external JavaScript file from the module.
Comment #5
clevername CreditAttribution: clevername commentedHmm, after over a week of sales, I'm still not seeing any data in my Analytics console. I'm not good enough at coding to figure out what's missing, but if I can provide any output data from my own site, I'll be more than happy to.
Comment #6
Island Usurper CreditAttribution: Island Usurper commentedOof. There was a typo in the patch. That last change looks in the wrong place for the analytics data. Revert changes and try this patch.
Comment #7
chazz CreditAttribution: chazz commentedI'll test path nr. 6 this evening as I am also looking for this feature
Comment #8
TR CreditAttribution: TR commentedI'm willing to commit this if someone can give it a good test.
Comment #9
Island Usurper CreditAttribution: Island Usurper commentedAs it turns out, the ga_post.js is required, and I think because of the version of ga.js that googleanalytics.module uses, Google also says it should go in the header which is different from the default setting that puts it in the footer.
It's required because there is also supposed to be an onsubmit callback for the form that actually fills out the analyticsdata element. I suppose a lot can happen in a year...or two.