Jump to content

Using Conversion Tracking


DimaK

Recommended Posts

You may put your Google Conversion Tracking Code in complete.tpl and under settings, set " Just show the order completed page (no payment redirect)"

 

This is not a good solution because it doesnt take people on the natural path to payment... It stops them unnecessarily.

 

We need a solution which doesnt involve diverting people away from paying for their hosting right away.

Link to comment
Share on other sites

  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...

I have it working to the point where if someone lands on /cart.php?a=complete, it counts as 1 goal conversion. Haven't figured out how to send the $ amount to GA though. Is what the trouble is? Maybe if we clearly outline whats not working someone from WHMCS will answer.

Link to comment
Share on other sites

  • 1 month later...

I just wanted to chime in and say this is retarded that it doesn't work. We have tried about a dozen methods and nothing works with accuracy.

 

I'm looking forward to a WHCMS update that makes this possible. But for now I'm giving up,

Thanks, Ben

Link to comment
Share on other sites

  • 4 weeks later...
I have it working to the point where if someone lands on /cart.php?a=complete, it counts as 1 goal conversion. Haven't figured out how to send the $ amount to GA though. Is what the trouble is? Maybe if we clearly outline whats not working someone from WHMCS will answer.

 

You dont send the price to GA you set a base price in the goal settings at GA

Scrapped ^

 

 

You will need to know the correct variable for the payment received to send this but append this to the tracking link

 

utmtto={$paymentvaluevaruable}

 

For further reading on this and there is a lot of it.

 

http://code.google.com/apis/analytics/docs/tracking/gaTrackingTroubleshooting.html

 

All you need to know is here

Edited by disgruntled
scrap previous.
Link to comment
Share on other sites

  • 8 months later...

Hope somebody will create a mod for it, I have added the tracking code in the complete.tpl in all order forms, and OUTISIDE the $ispaid if, to be SURE it will be executed, paid or not, but google ecommerce continue in CERO

 

all posts readed, literal used, php used, and blah blah.

 

{literal}

<SCRIPT language="JavaScript" type="text/javascript">

<!-- Yahoo!

window.ysm_customData = new Object();

window.ysm_customData.conversion = "transId={/literal}{$orderid}{literal},currency=,amount={/literal}{$amount}{literal}";

var ysm_accountid = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "

+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid

+ "></SCR" + "IPT>");

// -->

</SCRIPT>

{/literal}

 

{literal}

<script type="text/javascript">

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

</script>

 

{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}

<script type="text/javascript">

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

</script>

 

<script type="text/javascript">

var pageTracker = _gat._getTracker("XXXXXXXX");

pageTracker._setDomainName(".XXXXXX.com");

pageTracker._setAllowHash(false);

pageTracker._trackPageview();

 

pageTracker._addTrans(

"{/literal}{$orderid}{literal}", // Order ID

"BuyHTTP", // Affiliation

"{/literal}{$amount}{literal}", // Total

"0", // Tax

"0", // Shipping

"{/literal}{$city}{literal}", // City

"{/literal}{$state}{literal}", // State

"{/literal}{$country}{literal}" // Country

);

 

pageTracker._addItem(

"{/literal}{$orderid}{literal}", // Order ID

"{/literal}{$packageid}{literal}", // SKU

"{/literal}{$name}{literal}", // Product Name

"{/literal}{$type}{literal}", // Category

"{/literal}{$amount}{literal}", // Price

"1" // Quantity

);

pageTracker._trackTrans();

</script>

{/literal}

 

 

 

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
  • 2 months later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated