Post by stonehinged » Sat May 28, 2011 1:24 am

I am running 1.4.7 so can't yet do VQ Mods (I suspect).

I see from another post off of this thread that someone indicated that "model_checkout_order" doesn't seem to have a "getOrderProducts" method anymore, and the shipping total was missing as well... they went on to say they used the following instead on success.php:

$this->load->model('account/order');

$this->data['orderDetails'] = $this->model_account_order->getOrder($this->session->data['order_id']);
$this->data['orderDetails']['shipping_total'] = $this->session->data['shipping_method']['cost'];
$this->data['orderProducts'] = $this->model_account_order->getOrderProducts($this->session->data['order_id']);

but I have just tried this with still no luck.

STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/


User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:10 am
Location - US

Post by traceofwind » Sat May 28, 2011 2:02 am

Hi stonehinged,

Good find -can you link the post? Otherwise I'll find it myself.

Cheers

New member

Posts

Joined
Fri Jul 02, 2010 6:37 am

Post by stonehinged » Sat May 28, 2011 2:10 am

It's within this same topic, but meant to repost:

http://forum.opencart.com/viewtopic.php ... ilit=ecomm

Keep me posted on anything you come up with :)

STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/


User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:10 am
Location - US

Post by traceofwind » Sat May 28, 2011 2:31 am

Code: Select all

$this->load->model('account/order');

$this->data['orderDetails'] = $this->model_account_order->getOrder($this->session->data['order_id']);
$this->data['orderDetails']['shipping_total'] = $this->session->data['shipping_method']['cost'];
$this->data['orderProducts'] = $this->model_account_order->getOrderProducts($this->session->data['order_id']);
I don't see where anyone suggests the above code should go on controller/success.php?

Incidentally, I am giving this extension a go -at this point I am over my deadline and need a solution quick. That extension, Google Analytics Pro adds ecommerce tracking and (after 5-10 minutes looking at the code) it looks like a fairly elegant solution and easy to install. The extension is mentioned on the forum, too.

Will keep you posted

Gary

New member

Posts

Joined
Fri Jul 02, 2010 6:37 am

Post by stonehinged » Sat May 28, 2011 2:53 am

Second post it mentions ...In catalog/controller/checkout/success.php...

The extension says compatible with 1.4.9.5

That may play havoc with me being on 1.4.7.

But let me know how it goes for sure.

STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/


User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:10 am
Location - US

Post by traceofwind » Sat May 28, 2011 2:59 am

Hi Stonehinged,

You might be in luck -the author has included respective archives for different Opencart versions -see attached pic for info. There isn't a a version for 1.4.7 specifically but perhaps it's worth shotting the author a PM or enquiry to see if one will work for you?

Gary

Attachments

gapro.png

Google Analytics Pro - gapro.png (7.43 KiB) Viewed 10840 times


New member

Posts

Joined
Fri Jul 02, 2010 6:37 am

Post by traceofwind » Sat May 28, 2011 3:03 am

stonehinged wrote:Second post it mentions ...In catalog/controller/checkout/success.php...
Hi again,

Yeah I know the code is supposed to go in /controller/checkout/success.php -Justinv appended this to the first post, but were you suggesting that it needs to go elsewhere?

Gaz

New member

Posts

Joined
Fri Jul 02, 2010 6:37 am

Post by stonehinged » Sat May 28, 2011 3:43 am

Nope.

/controller/checkout/success.php was where I understand the code goes... didn't mean to create any confusion there.

Great idea on reaching out to the extension developer. Will certainly ask the question. Thanks.

I'm hopeful once Google Ecom tracking can be achieved, whatever variable is used for OrderTotal will work for my Google AdWords (PPC) tracking as well!

STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/


User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:10 am
Location - US

Post by goldndelicious » Sat Jun 04, 2011 5:24 am

Hi,

I'm having some odd findings with this.

i have 3 sites that i look after. I have followed the instructions exactly all three times. It works for 1, but not the other two.

The working site, and one of the others are pretty much identical clones of each other, and i've compared the files which are identical (apart from the obvious such as the unique google analytics reference etc)

Both have been set up the same in analytics too.

any ideas why one might work but the other two don't?

cheers!

personalised car signs
personalised bedroom door signs
personalised gifts for kids


New member

Posts

Joined
Sun Oct 04, 2009 8:22 am

Post by justinv » Sat Jun 04, 2011 8:02 am

are you talking about my instructions or the module mentioned above?

What versions are your carts? How do you know it's not working (maybe a dumb question but could be important)?

Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
Image


Active Member

Posts

Joined
Tue Oct 12, 2010 1:24 pm

Post by goldndelicious » Sat Jun 04, 2011 6:06 pm

I've followed your instructions on the first post and done this manually.

I've tested the site by using "cash on delivery" and putting through some false transactions. All of the transactions from one site work, none of the transactions from the other site do.

I've ensured i'm looking at the correct date range in google analytics (as it normally defaults to not include todays traffic)

all sites are 1.4.8b

The working site is a clone of a non working site - ie the non working site was my first online shop, i then expanded my business, and rather than rebuild a new site, i simply copied all the files and the database to another server, then just edited the products i used, so any modifications i've made are apparent in both sites.

Any thoughts on how i can troubleshoot this? Could there be any other factors that would prevent this from working (ie modifications to the site elsewhere, or other settings within google analytics?)

Cheers

working site : http://www.personalisedrewardcharts.co.uk
cloned from http://www.personalisedcarsigns.co.uk - not working

other non working site http://www.sheetplastics.co.uk

personalised car signs
personalised bedroom door signs
personalised gifts for kids


New member

Posts

Joined
Sun Oct 04, 2009 8:22 am

Post by justinv » Sat Jun 04, 2011 6:12 pm

I'd start by running through the order process. On the checkout/success page the analytics code should be present - you should view the source of the page to make sure it is. If it is, the next thing is to make sure there are no js errors. These will prevent the analytics code from working. Finally, if all these are ok, perhaps making sure you have set the ua-xxxxxx correctly would be my last thought.

Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
Image


Active Member

Posts

Joined
Tue Oct 12, 2010 1:24 pm

Post by goldndelicious » Sun Jun 05, 2011 12:35 am

Thanks for your help on this, it appears that simply giving it more time has sorted it out.

all sites are now working and tracking orders, so if anyone doesn't succeed first time, give it a few days then try again. It seems to have taken about 48 hours to start working, but all looks fine now.

Thanks!

personalised car signs
personalised bedroom door signs
personalised gifts for kids


New member

Posts

Joined
Sun Oct 04, 2009 8:22 am

Post by justinv » Sun Jun 05, 2011 11:19 am

I have packaged this as a module, available for download for free at http://opencart.hostjars.com/

Hope that's helpful to someone - I note there is also a vQmod available on page 1 of this topic, also helpful.

Thanks

Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
Image


Active Member

Posts

Joined
Tue Oct 12, 2010 1:24 pm

Post by tomtom » Tue Jul 26, 2011 6:38 pm

Hi, anybody else having problems with the normal tracking since installing this module from Justinv? I've noticed my visits have droped to 1-2 a day where b4 they were like 50-60 a day. The sales have not dropped though, and GA is recording the Transactions, just not the visits correctly.

According to Google the new async tracker must be just before the </head> tag, with this module it is positioned somewhere in the body depending on when the module is installed, and I can't control where the module is positioned. Could this be the reason it is not working correctly?

I wrote Justin on his site but no response yet, any help would be greatly appreciated.

-Tom

New member

Posts

Joined
Sun May 23, 2010 8:28 pm

Post by tomtom » Tue Aug 02, 2011 8:22 pm

In case anyone else needs this for Justinvs module (for 1.4.9)

Change the positioning of the tracker to just before the </head> tag as suggested by google.

Add this to /catalog/controller/common/header.php

Code: Select all

  
$headtag_data = array();
  $sorting_order  = array();
  $headtag_results  = $this->model_checkout_extension->getExtensions( 'module' );
  foreach( $headtag_results as $headtag_result ) {
   if( $this->config->get( $headtag_result['key'] . '_status' )
   && ( $this->config->get($headtag_result['key'] . '_position' ) == 'headtag' ) ) {
    $headtag_data[] = array(
     'code'       => $headtag_result['key'],
     'sort_order' => $this->config->get( $headtag_result['key'] . '_sort_order' )
    );
    $this->children[] = 'module/' . $headtag_result['key'];
   }
  }
  foreach( $headtag_data as $key => $value ) {
        $sorting_order[$key] = $value['sort_order'];
     }
     array_multisort( $sorting_order, SORT_ASC, $headtag_data );
  $this->data['headtags'] = $headtag_data;
  // end getting <head> modules
and in /admin/view/template/module/tracking.tpl on line 14 i changed this:

Code: Select all

<input type="hidden" name="tracking_position" value="left"> 
to this

Code: Select all

<input type="hidden" name="tracking_position" value="headtag">
in /admin/controller/module/tracking.php

Code: Select all

$this->data['text_headtag']            = $this->language->get('text_headtag');


and the corresponding language file admin/language/yourlanguage/module/tracking.php

Code: Select all

$_['text_headtag']     = 'head tag';


and then added in /view/theme/mytheme/template/module/tracking.tpl as it was missing from the javascript

Code: Select all

  _gaq.push(['_trackPageview']);
-T

New member

Posts

Joined
Sun May 23, 2010 8:28 pm

Post by countzer0 » Sun Nov 13, 2011 6:24 pm

Would this method work for 1.5.1.x? I have searched the forums but all info seems to apply to 1.4.9.x...

A happy OpenCart developer from Brighton.


User avatar
New member

Posts

Joined
Sat Jun 18, 2011 11:09 pm
Location - Brighton, UK

Post by countzer0 » Mon Nov 14, 2011 5:03 am

To answer my own question, the code written by justinv will work for 1.5.1.x with a few mods. I have modified philbydevil's vQmod so that it will work on 1.5.1.x - see attached.

Thanks everyone for your help with this!

Edit: Removed the attachment as it has an error in it which prevented it from working sometimes. Get the corrected code from this post.
Last edited by countzer0 on Thu Jan 05, 2012 5:16 pm, edited 1 time in total.

A happy OpenCart developer from Brighton.


User avatar
New member

Posts

Joined
Sat Jun 18, 2011 11:09 pm
Location - Brighton, UK

Post by tomtom » Mon Nov 14, 2011 3:21 pm

I thought Google Analytics Ecommerce Tracking would be in the core by now. :ponder:

New member

Posts

Joined
Sun May 23, 2010 8:28 pm

Post by Kim_A » Wed Nov 23, 2011 4:30 am

Should i remove the normal tracking code if i use this mod?

Newbie

Posts

Joined
Tue Nov 08, 2011 6:10 pm
Who is online

Users browsing this forum: No registered users and 2 guests