Jump to content

Google Analytics Conversion Tracking - Goals


Recommended Posts

We need to define a Thank You page to google which will serve as a completion of a "goal". This needs to be any page which shows after completion of a sale.

 

We also need to run some custom tracking scripts. Which page can we add them to?

Link to comment
Share on other sites

What about a goal as "htlps://wvw.paypal.com/cgi-bin/webscr"?

 

Or htlps://wvw.example.com/whmcs/subscriptionforward.php

 

Or even just htlps://wvw.example.com/whmcs/order.php?step=5

 

 

* I don't have 15 posts so I can't submit htlps or wvw *

Link to comment
Share on other sites

I think you can also use funneling to track the order progression. You can find this on the Goal page.

 

You'll have to do this as well:

google.com/support/analytics/bin/answer.py?answer=27203

(is it possible to add/use that code in whmcs order pages?

Link to comment
Share on other sites

Hi Matt,

 

Actually, we need the URL of the final page after order completion.

 

Thanks

 

Well for PayPal don't you have an option of sending the customer to a webpage once the payment has been made? I think you can send them to a new webpage or have them return to the page they came from.

Link to comment
Share on other sites

  • 4 months later...
The final url of the order process is order.php?step=complete

 

Is this still correct? It seems as though the final order URL (that loads a page) is order.php?step=5 -- There seems to be a step=6 as well but it's a 302...

 

Edit: I just ran through a new order to test... I never get a page load after step 4, just a redirect to the invoice to pay it, then off to PayPal...

 

So I guess the question still stands - how do we track a new order?

 

Edit2: Ok, apparently the auto redirect to invoice setting has to be off for this to work, and I end up at a URL (for a PayPal payment) of step=checkout

Link to comment
Share on other sites

I don't have time to finish this tonight (or next week for that matter) but someone will be able to take this and run with it...

 

I'm also going to try to get the Ecommerce reporting working as well in Analytics. (http://www.google.com/support/googleanalytics/bin/answer.py?answer=55528&topic=11002)

 

The good news is it should be possible. The bad news is that (almost) none of the data Google needs/wants is available in the smarty variables in the step=checkout stage. (Which uses the order-complete.tpl file)

 

We do have access to the order number, and from there can use a pair of MySQL queries to get the data. We need to use the Smarty {php} function, and have alot of work to do...

 

First, here's the basic queries:

select o.ordernum as `order-id`, null as affiliation, i.total as total, i.tax as tax, 0 as shipping, c.city as city, c.state as `state/region`, c.country as country FROM tblorders o LEFT JOIN tblinvoices i ON o.invoiceid = i.id LEFT JOIN tblclients c ON o.userid = c.id;

select o.ordernum as `order-id`, null as `sku/code`, ii.description as `product name`, ii.type as category, ii.amount as price, 1 as quantity from tblorders o LEFT JOIN tblinvoiceitems ii ON o.invoiceid = ii.invoiceid;

 

The first gets the transaction information, the second the items on the invoice for the order. (The where clauses, and query alias cleanup are left as an exercise for the reader.)

 

In the smarty {php} block you need to get the order number by using the function get_template_vars ($varname). In this case "$ordernum = $this->get_template_vars('ordernumber');" should do the trick.

 

Once you have the data back form MySQL you need to push the data back into smarty. $this->assign($var, $val) will do that.

 

Now if you handle the Google form creation in the {php} tag, or push the raw MySQL return and use smarty to iterate, is up to you.

 

If anyone else has any better ideas, I'm all ears. :D

Link to comment
Share on other sites

Only if you have the automatically redirect to invoice at the end of an order option selected - and this option isn't new in 3.4.1 - it's always been there.

 

Matt

 

There are 3 options in 3.4:

 

1. Select to not automatically redirect and just show the order completed page

2. Select to automatically redirect the user to the invoice

3. Select to automatically redirect the user to the gateway

 

I just checked all three options and each time I was redirected back to the PAID invoice after payment.

 

I never got to order.php?step=complete

 

Is this due to the single page order form?

Link to comment
Share on other sites

What is the nicest manner to fix it?

 

We like to have the code before the redirect to any payment gateways, because we use several gateways and not any one of them supports redirects back to us after payment.

 

 

So is there a universal method that works.

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