Ecommerce Tracking Implementation

Hello All-

I’ve been trying to integrate Piwik’s eCommerce tracking into Concrete5 (CMS). I think that I’m very close, I was wondering if anyone could check the resulting code that renders - to check if it is properly formatted for Piwik.

The code that my PHP outputs is:


<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.zoodlemarketing.com/analytics/" : "http://www.zoodlemarketing.com/analytics/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 8);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
piwikTracker.addEcommerceItem(
"13", // (required) SKU: Product unique identifier
"Purple Shirt", // (optional) Product name
"", // (optional) Product category. You can also specify an array of up to 5 categories eg. ["Books", "New releases", "Biography"]
79.00, // (recommended) Product price
1 // (optional, default to 1) Product quantity
);
piwikTracker.addEcommerceItem(
"20", // (required) SKU: Product unique identifier
"Fluff Neck", // (optional) Product name
"", // (optional) Product category. You can also specify an array of up to 5 categories eg. ["Books", "New releases", "Biography"]
59.00, // (recommended) Product price
1 // (optional, default to 1) Product quantity
);
piwikTracker.trackEcommerceOrder(
"275", // (required) Unique Order ID
138, // (required) Order Revenue grand total (includes tax, shipping, and subtracted discount)
138, // (optional) Order sub total (excludes shipping)
, // (optional) Tax amount
, // (optional) Shipping amount
false // (optional) Discount offered (set to false for unspecified parameter)
);
} catch( err ) {}
</script><noscript><p><img src="http://www.zoodlemarketing.com/analytics/piwik.php?idsite=8" style="border:0" alt="" /></p></noscript> 

If anyone can point out where that is incorrect, I would greatly appreciate it.

Thank you!

Lee Salminen

Looks good, but we recommend to also track product category: one “Books” or many [“Books”,“Adventure”]

Hey Matt-

Is product category tracking a required attribute?

I ask because I thought the syntax looked OK as well, but when I hit the page where the above JS is there is no reflection in Piwik reporting.

I’m implementing this into a CMS that puts the generic tracker script on every page - so when you land on the Finish Checkout page there’s the original tracking script and this trackeCommerceOrder. Can there be only one instance of this JS per page? I believe I tested this anyway to no avail, but just want to make sure.

We are using Piwik on ~40 sites and all track OK (not eCommerce). So, I know it’s not a server issue.

Thanks for all your help! This has been frustrating me for weeks.

Lee

You can test with firefox + firebug to see if there is any JS erro rand the http requests. Then you will know if it works.
Do you plan to release your concrete5 CMS? we really hope to have more ecommerce support for such softwares, we could list it on the Plugins page on piwik.org!

Thanks for the advice, Matt. I’m heading out of the office for the day, but will test/debug first thing Monday morning. I think I looked through JS for errors, but definitely did not check HTTP requests…good idea!

concrete5 (www.concrete5.org) is my favorite CMS. I’ve developed for all the major players, and c5 beats them out every time. It’s amazing for developers (I don’t want to pull my hair out like coding a WP loop() ). And the inline editing is something clients really love. I recommend c5 for about 95% of all proposals that come my way. If you’re a web developer, I would definitely give it a spin.

And yes, once I figure out this eCommerce tracking I will be submitting it to their marketplace of add-ons and would love to have c5 listed on Piwik’s site.

Enjoy your weekend!

Lee

Hey Matt–

Just wanted to let you know that we were able to successfully get eCommerce tracking working for all of our clients.

Thank you so much for your help.

Lee

Good to know. would be great to release your concrete5 CMS plugin. Cheers

Visit [Ledger Labs] for Ecommerce Tracking Implementations

Thank you for your guidance. Finally tracking is working after apply it on Jelly Roll Merchandise. It is highly recommended for everyone.