close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Enhanced Ecommerce Web Tracking

Thread began 3/20/2015 9:16 pm by Lee Firth | Last modified 4/02/2015 12:07 pm by Lee Firth | 1940 views | 8 replies

Lee Firth

Enhanced Ecommerce Web Tracking

I am trying to add Google enhanced eCommerce web tracking to my checkout_success.php page. Here is the js/php code I have used:

ga('ec:addProduct', {
'id': '<?php echo $eCart1->DisplayInfo("SKU"); ?>',
'name': '<?php echo $eCart1->DisplayInfo("Name"); ?>',
'price': '<?php echo $eCart1->DisplayInfo("Price"); ?>',
'quantity': '<?php echo $eCart1->DisplayInfo("Quantity"); ?>'
});

The problem I am having is that after a successful transaction and you are redirected to the success page, if I look at the source code I can see that all the $eCart1->DisplayInfo values are blank in the java-script code used for enhanced eCommerce, even though this same page uses the same eCart code to add the order details

$ReplaceQuery->bindColumn("DetailOrderID", "d", "".$_SESSION['orderID'] ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailProductID", "d", "".$eCart1->DisplayInfo("ID") ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailName", "s", "".$eCart1->DisplayInfo("Name") ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailPrice", "d", "".$eCart1->DisplayInfo("Price") ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailSKU", "s", "".$eCart1->DisplayInfo("SKU") ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailQTY", "d", "".$eCart1->DisplayInfo("Quantity") ."", "WA_DEFAULT");

which work fine.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...