I’m using piwik for tracking and http://www.whmcs.com for billing… and need some help tracking the sales.
the piwik tag is tracking correctly (placed in the footer template of whmcs billing software) but I can’t figure out how to track the actual sale amount/item etc just using the goals feature…
Other whmcs.com software users have this working with google analytics by adding additional code to the page that is fired EVERY time there is a successful transaction.
So when a transaction is compelted this pages template AND the footer template are executed.
Here’s the an example of the completed sale template that works with Google
{php}
$orderid = $this->get_template_vars(‘orderid’);
$userid = $_SESSION[“uid”];
// get client data
$result = select_query(“tblclients”,“city, state, country”,array(“id”=>$userid));
$data = mysql_fetch_array($result);
$city = $data[“city”];
$state = $data[“state”];
$country = $data[“country”];
$this->assign(‘city’,$city);
$this->assign(‘state’,$state);
$this->assign(‘country’,$country);
// get package name
$result = select_query(“tblhosting”,“packageid”,array(“orderid”=>$orderid));
$data = mysql_fetch_array($result);
$packageid = $data[“packageid”];
$result = select_query(“tblproducts”,“name, type”,array(“id”=>$packageid));
$data = mysql_fetch_array($result);
$name = $data[“name”];
$type = $data[“type”];
$this->assign(‘name’,$name);
$this->assign(‘type’,$type);
$this->assign(‘packageid’,$packageid);
{/php}
{literal}
{/literal}
I’m not a coder by any means… BUT I’m wondering if this will also work with piwik ??? and if so what has to be changed?