Jump to content

Using Conversion Tracking


DimaK

Recommended Posts

  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

This is a PITA.... But....

 

I *think* I've got it working correctly. I have it working for a $0.00 item, but there are a few tweaks that I had to make.

 

First, you *cannot* auto-redirect the user to either the invoice or gateway.

 

Your tracking code may fire *before* the user pays. If a user pays with PayPal they never go (back) to the order complete screen. I don't know about others.

 

My code ended up having to walk the invoice items via a DB call to get the details needed for the Google tracker. It looks good on paper, now I'm going to give it a bit and see if/how it works.... more later.

 

Edit: Also, keep in mind this doesn't track recurring payments at all. (I.E. WHMCS generates an invoice and they come back to pay it.)

Link to comment
Share on other sites

  • 6 months later...
If you need the total amount the order was for then you would use a code block like the below one to assign the {$amount} variable for use elsewhere in the template

 

{php}
$orderid = $this->get_template_vars('orderid');
$result = select_query("tblorders","amount",array("id"=>$orderid));
$data = mysql_fetch_array($result);
$amount = $data["amount"];
$this->assign('amount',$amount);
{/php}

 

So that would then enable you to do something like this in your tracking code:

 

<img src="http://order-tracker.com/?ordernumber={$orderid}&amount={$amount}" width="1" height="1" border="0" />

 

Matt

 

Now what about paypal where they may not be redirected back to order complete? Do something in paypal IPN?

Link to comment
Share on other sites

  • 1 month later...

Yes, I don't understand why developer don't want to show it in Documentations...

 

You can place tracking code to

templates/orderforms/default/complete.tpl

(if you are using "default" order form)

 

==========================

{if $ispaid}

 

{literal}

 

<!-- Google Code for Purchase Conversion Page -->

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

<!--

var google_conversion_id = 12313131313;

var google_conversion_language = "en_US";

var google_conversion_format = "1";

var google_conversion_color = "666666";

if (1.0) {

 

{/literal}

 

 

var google_conversion_value = {$amount};

 

{literal}

}

var google_conversion_label = "Purchase";

//-->

</script>

<script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">

</script>

<noscript>

<img height=1 width=1 border=0 src="http://www.googleadservices.com/pagead/conversion/12313131313/?value=1.0&label=Purchase&script=0">

</noscript>

 

{/literal}

 

{/if}

 

===============================

Link to comment
Share on other sites

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

Any update on this? With no response from WHMCS I'm assuming they either dont care or don't have an answer. The wiki information on this topic is very basic and not very good either.

 

I'm testing something out now but a definite answer would be helpful because it takes a few days to collect data and be able to tell if its working.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

{if $ispaid}
<!-- Enter any HTML code which needs to be displayed once a user has completed the checkout of their order here - for example conversion tracking and affiliate tracking scripts -->
{/if}

Is this still what we'd use to track conversions, or have things changed over the past 2 years?

Link to comment
Share on other sites

  • 2 weeks later...

We're receiving inaccurate results all over the place.

 

We want to add all of our tracking pixels to where they're executed before the payment redirect.

 

Basically, once the user checks the box to agree to the TOS and clicks Submit it then executes all of our tracking pixels etc regardless of payment. We can write scripts to go through and validate valid conversions later. This current setup is just too unreliable as people will pay with paypal and not come back to the complete page. Some people pay via credit card later on and don't see the complete page as they login through /billing/ to do it etc

 

Is there any way this can be possible?

Link to comment
Share on other sites

We're receiving inaccurate results all over the place.

 

We want to add all of our tracking pixels to where they're executed before the payment redirect.

 

Basically, once the user checks the box to agree to the TOS and clicks Submit it then executes all of our tracking pixels etc regardless of payment. We can write scripts to go through and validate valid conversions later. This current setup is just too unreliable as people will pay with paypal and not come back to the complete page. Some people pay via credit card later on and don't see the complete page as they login through /billing/ to do it etc

 

Is there any way this can be possible?

 

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

Link to comment
Share on other sites

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