Post by stringsetc » Sun Aug 18, 2013 11:13 pm

Hi guys,

I still get the following error and google analytics is only tracking about 25% of my conversions. any ideas why

these are the errors :

Code: Select all

PHP Notice:  Undefined variable: orderDetails in /public_html/vqmod/vqcache/vq2-catalog_view_theme_gentle_template_common_success.tpl on line 63
PHP Notice:  Undefined variable: orderDetails in /public_html/vqmod/vqcache/vq2-catalog_view_theme_gentle_template_common_success.tpl on line 70

Active Member

Posts

Joined
Thu Feb 16, 2012 11:59 pm

Post by stringsetc » Sat Aug 24, 2013 8:17 pm

still searching for this one ... somebody did mention it earlier in the thread but there seemed to be no answer

Active Member

Posts

Joined
Thu Feb 16, 2012 11:59 pm

Post by spaniakos » Wed Oct 16, 2013 7:19 pm

sorry for not updating the module for new releases , but right now i have not time for it cause i am working and getting my masters degree.
i will do it with first chance .

thanks

Newbie

Posts

Joined
Fri Feb 22, 2013 11:17 pm

Post by moneycarlo » Tue Oct 29, 2013 3:26 am

don't worry, google has now added a new analytics tag with more options, analytics.js. haha
i guess it can work in conjunction with ga.ja
https://developers.google.com/analytics ... alyticsjs/

Active Member

Posts

Joined
Wed Sep 28, 2011 3:40 am

Post by stringsetc » Sat Nov 02, 2013 1:44 am

yea this still isn't working. I've managed to get rid of the errors, but only around 30% of orders are showing as ecommerce conversions in google analytics. I thought I had it cracked the other week when I realised that not everybody is definately seeing the success page as they would have to click to be brought back from PayPal, so I turned on auto redirect once payment is made so now everyone sees the success page with the tracking code but still the figures in analytics don't match the actual number of orders made.

anybody any ideas? driving me insane!

Active Member

Posts

Joined
Thu Feb 16, 2012 11:59 pm

Post by 1nkling » Mon Nov 04, 2013 9:05 pm

stringsetc wrote:yea this still isn't working. I've managed to get rid of the errors, but only around 30% of orders are showing as ecommerce conversions in google analytics. I thought I had it cracked the other week when I realised that not everybody is definately seeing the success page as they would have to click to be brought back from PayPal, so I turned on auto redirect once payment is made so now everyone sees the success page with the tracking code but still the figures in analytics don't match the actual number of orders made.

anybody any ideas? driving me insane!
Same here. In some ways this is working. I am getting some ecommerce figures through.

Like stringsetc I'm not getting all my sales recorded though. I tried the same success page redirect but it hasn't helped. Today I've had a couple of sales but nothing shown. Yesterday I had 8 sales but only 3 have tracked.

Also the figures being tracked include the postage. Just having the product figures would be good.

Newbie

Posts

Joined
Sun Oct 23, 2011 9:54 pm

Post by storm-cloud » Wed Jun 04, 2014 1:55 pm

Just thought I would let others know that the steps (or vQmod) outlined in this post: http://forum.opencart.com/viewtopic.php ... 00#p384806 to generate the product category fails if there is more than one of the same product with different variations (product options) added to the cart.

I believe this may be due to the product with the variations being considered as the same product, therefore the script does not generate a copy of the category over to each variation and instead returns an empty result.

Would anyone know how to correct this?

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by spaniakos » Fri Jun 06, 2014 6:08 pm

hello all , with first chance i will update the module to new opencart version and i will make it an official module on opencarts module database. it will still be free to use. storm-cloud have provided me some error information.

i will notify you by posting in this forum.

thanks.

Newbie

Posts

Joined
Fri Feb 22, 2013 11:17 pm

Post by 1nkling » Thu Jul 24, 2014 8:58 pm

Really looking forward to the update when you get the chance and appreciate your hard work. :)

Newbie

Posts

Joined
Sun Oct 23, 2011 9:54 pm

Post by suleman1103 » Sat Nov 08, 2014 6:05 pm

For Paypal You can use this as eccomerce does not work properly with paypal
http://marketlytics.com/accurately-inte ... ecommerce/

Newbie

Posts

Joined
Sat Nov 08, 2014 6:03 pm

Post by darrshelen » Mon Nov 24, 2014 6:06 pm

+1 looking forward for the update .
Days to Fitness
Thanks Best Phone Grip
WoW Gold
Best Regards
Helen VD.
Last edited by darrshelen on Tue Nov 24, 2015 3:38 am, edited 4 times in total.

Newbie

Posts

Joined
Mon Nov 24, 2014 6:04 pm

Post by abraxis90 » Wed Dec 24, 2014 3:17 am

Any way of adding adwords conversion tracking quick and easy? I was thinking about loading it on the checkout.php for completed orders. Is this a viable solution?

Newbie

Posts

Joined
Sun Dec 21, 2014 12:42 am

Post by cocorichelle » Tue Feb 17, 2015 1:55 am

Has anyone set-up ecommerce tracking with OpenCart version 2.x ?
I am using 2.0.1.1 and am having trouble.
Thanks!

Newbie

Posts

Joined
Tue Feb 17, 2015 1:53 am

Post by Substruct » Thu Feb 19, 2015 1:25 am

Thank you very much! This is really working solution for Open Cart 2.0

But for this code in Open Cart 2.0:
-----------------------------------------------
$this->load->model('checkout/order');
$this->data['orderDetails'] = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$this->data['orderProducts'] = $this->model_checkout_order->getOrderProducts($this->session->data['order_id']);

Use:
-----------------------------------------------
$this->load->model('checkout/order');
$data['orderDetails'] = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$data['orderProducts'] = $this->model_checkout_order->getOrderProducts($this->session->data['order_id']);

Newbie

Posts

Joined
Thu Feb 19, 2015 1:21 am

Post by cocorichelle » Wed Feb 25, 2015 12:49 am

Here's the modification we ended up using for OpenCart version 2.0.1.1 (we are using a custom theme, as well):

Code: Select all

	<file name="catalog/controller/checkout/success.php">
        <operation>
            <search position="before"><![CDATA[
            $this->cart->clear();
            ]]></search>
            <add><![CDATA[
            $this->load->model('account/order');
            $data['orderDetails'] = $this->model_account_order->getOrder($this->session->data['order_id']);
            $data['orderProducts'] = $this->model_account_order->getOrderProducts($this->session->data['order_id']);
            $data['orderTotals'] = $this->model_account_order->getOrderTotals($this->session->data['order_id']);
            ]]></add>
        </operation>
	</file>
And

Code: Select all

	<file name="catalog/view/theme/pavilion/template/common/success.tpl">
        <operation>
            <search position="before"><![CDATA[
			<div class="tb_submit clearfix">
            ]]></search>
            <add><![CDATA[
            <?php if( isset($orderDetails) && isset($orderProducts) && isset($orderTotals) ) { ?>
				<script>
					var tsOrderDetails = <?= json_encode($orderDetails) ?>;
					var tsorderProducts = <?= json_encode($orderProducts) ?>;
					var tsorderTotals = <?= json_encode($orderTotals) ?>;
				</script>
				<script src="catalog/view/javascript/ecommerce.js"></script>
			<?php } ?>         
            ]]></add>
        </operation>
	</file>
On the ecommerce.js file:

Code: Select all

// shipping
if ( jQuery.grep(tsorderTotals, function(e){ return e.code == 'shipping'}).length == 1 ) { tsShipping = jQuery.grep(tsorderTotals, function(e){ return e.code == 'shipping'})[0].value; }
else { tsShipping = 0; }

//tax
if ( jQuery.grep(tsorderTotals, function(e){ return e.code == 'tax'}).length == 1 ) { tsTax = jQuery.grep(tsorderTotals, function(e){ return e.code == 'tax'})[0].value; }
else { tsTax = 0; }

ga('require', 'ecommerce', 'ecommerce.js');

ga('ecommerce:addTransaction', {
  'id': tsOrderDetails.order_id,
  'affiliation': 'NAME OF COMPANY',
  'revenue': tsOrderDetails.total,
  'shipping': tsShipping,
  'tax': tsTax
});

for(var i = 0; i < tsorderProducts.length; i++) {
  ga('ecommerce:addItem', {
    'id': tsOrderDetails.order_id,
    'name': tsorderProducts[i]['name'],
    'sku': tsorderProducts[i]['product_id'],
    'category': '',
    'price': tsorderProducts[i]['price'],
    'quantity': tsorderProducts[i]['quantity']
  });
}

ga('ecommerce:send');
Hopefully this helps someone!

Newbie

Posts

Joined
Tue Feb 17, 2015 1:53 am

Post by willows » Wed Sep 16, 2015 4:25 pm

There is new google ecommerce tracking where you can send in the contents of the basket into google.

You can see the google ecommerce tracking example at this link. https://www.willows-consulting.com/Open ... ncart.html

This has the xml vqmod file there for editing.
Hope this helps folks.

Available for hire for maintenance, installs, hacks, SEO disasters, and integrations with epos, logistics and accounts systems.
Opencart Developers Ireland
Image


User avatar
New member

Posts

Joined
Sun Mar 17, 2013 5:19 am
Location - Dublin Ireland

Post by arosesiej » Mon Oct 05, 2015 9:44 pm

Hi,

Is there a corrected version for 1.5.x?

I need this code to track things in GA... and with all the comments and replies its a little hard to follow what I should be editing or if the zip file on the first/second page is a working mod?

New member

Posts

Joined
Thu Jun 25, 2015 8:52 pm

Post by labeshops » Fri Jul 15, 2016 8:35 pm

willows wrote:There is new google ecommerce tracking where you can send in the contents of the basket into google.

You can see the google ecommerce tracking example at this link. https://www.willows-consulting.com/Open ... ncart.html

This has the xml vqmod file there for editing.
Hope this helps folks.
Just saw this for v2.2 which is great, but I notice you are hard coding in the google analytics code. This is a problem for multistores of course. Do you have a version for it?

Running Opencart v2.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by a4anantdhiman » Fri Feb 09, 2018 12:41 am

I added the same code mentioned by "justinv" step by step and i am able to see record in google

But still, i am not able to see all records there, there were 14 orders on 7th Feb 2018 but in google i can only see 10 transaction

Please let me know what could be the reason ?

Newbie

Posts

Joined
Fri Feb 09, 2018 12:35 am

Post by opencartturk » Tue Mar 27, 2018 9:50 pm

I have a site that does an open cart installation and I would like to add this kind of analysis to my packages, but the module is having problems in every version.
http://e-ticaretopencart.com/

Newbie

Posts

Joined
Tue Mar 27, 2018 9:46 pm
Who is online

Users browsing this forum: No registered users and 3 guests