3 replies [Last post]
rennsix's picture
Offline
Uber Donor
Joined: 09/11/2008
Juice: 89
Was this information Helpful?

The accountant has been noticing that orders created on the back end by an administrator aren't getting sent to our Google Analytics because they never get sent to '/cart/checkout/complete' which is my conversion goal in GA. Instead, the url for completing the payment is domain.com/admin/store/orders/OrderID/payments.

Also, when you enter a payment and click apply it is still the same url so I don't see how you could get this to GA.

So I understand why the data isn't getting into the GA account but wondering if there is a way to get it working?

Andy's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 1076
Re: orders created by adminstrator not sending to google analyti

We looked at pushing admin orders to GA a few months ago, and I'm going off of my memory here but as I remember Ubercart doesn't even include the GA java script in admin pages (this would fill GA with lot's of stuff most people don't want included in their analytics). We considered rigging things so Ubercart would send the correct info to GA from the admin order submit page, but there were a few issues with that. We create a lot of orders which are really quotes, and these would be included (not good) we also found it difficult to decide exactly when to submit the info to GA since we tend to submit / edit the form multiple times while entering the order. Plus this approach would result in two conversion paths / sets of transactions which seems problematic. After looking at it a while we decided that it wasn't worth the effort and moved on. The more we thought about it we decided that we really didn't want to implement this feature (for us at least) because we get the total (web + admin) sales info from Ubercart / Quickbooks anyways, and we are decided it was best to keep GA just reporting on the web transactions which gives us an easy way to see the two sets of data independently.

However your use case may be different, and we should try to come up with a solution. I believe that the ideal solution would work like this. One time only, at an admin selected change of order status, by default when the order moves into processing, call '/cart/checkout/complete' with a specific set of post variables that 1. Provide the correct info to the GA java-script for submission to GA 2. sets a GA field to specify the order as admin created and 3. Specifically does not create an order or do any of the stuff that normally happens during submission. The only part of the issue this doesn't fix (I think) is that GA records the time stamp for the order based on when it was submitted, which could be very different from when the order moves into the selected status, however I don't think that is a critical flaw.

The real problem is the difficulty in implementing this solution. It requires great care not to create a security issue with the checkout process, and goes against the general security structure of Drupal form submission. Do the the sensitive nature of the checkout process great care should be taken in attempting this solution.

Perhaps an easier solution would be to basically do the same thing, but call a page (requiring admin permissions) dedicated to this purpose. This would require creating a separate conversion process in GA, and IMHO not be as nice, but it would be much easier.
Hope this helps...
--Andy

rennsix's picture
Offline
Uber Donor
Joined: 09/11/2008
Juice: 89
Re: Re: orders created by adminstrator not sending to google ana

Thanks for your input Andy. I really appreciate the time you spent outlining some potential options and I'm pretty confident we found a solution for our case.

I took some time to rethink how we could eliminate our team members from creating orders on the admin side all together. The biggest challenge we faced was letting team members create their own line items not in the catalog. It messed up the reports right off the bat. To add to the confusion no GA to show where all this money was coming from...nightmare. So right there we had a problem trying to find reports of line items which aren't there. Then, enters our accountant...insert angry face here.

So, to fight off any custom programming and security concerns I made two new product classes, one shippables class (can be shipped) and one non-shippables class. Then, I installed the variable price module. After that, I created some txt field attributes (Product Name, Product Description) and created one product for shippable and one non-shippable for $0 and included those attributes. Lastly, I created a dealer role and assigned specific users to that role and changed their passwords to something our team could manage. Now, any team member can find our dealer list, log into their account and place orders for custom non catalog items and checkout using their ship/bill info. This way, the dealer receives their emailed invoice and we get the GA conversion.

Of course we still have to pay attention to quickbooks for any shipping/returns/refunds that may have happened throughout the order process but it's much better then before.

-Colin

Andy's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 1076
Re: Re: Re: orders created by adminstrator not sending to google

I like your solution. For future use, there is a Drupal module out there similar to "su" on Linux which allows an administrator to "become" a different user and browse the site as that user. Off hand, I can't remember the module name and I'm to lazy to do the work, but a quick search on drupal.org should turn it up.
--Andy