newbie Posted November 15, 2007 Share Posted November 15, 2007 Yes, I need the google conversion scripts to work too. Seeing the amount of people interested it would be best that WHMCS suggest the best manner. 0 Quote Link to comment Share on other sites More sharing options...
pacwebhosting Posted November 15, 2007 Share Posted November 15, 2007 Hi open order-complete.tpl at the end place the following {literal} Google conversion code here {/literal} Thanks Paul 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted November 16, 2007 Share Posted November 16, 2007 We do need to find out a few things: 1) If we want to redirect to the invoice, is there a way to trigger a Google Analytics Goal? 2) Even with redirect off, my page flow never hits the step=complete URL. What are the other URLs that signify a completed (and paid/unpaid) order? A quick primer from Matt would go a long way -- just adding the stuff to order-complete.tpl doesn't help us when google needs to know the URL that is displayed for that template. (and for PayPal, no redirect to invoice, it's not step=complete.) 0 Quote Link to comment Share on other sites More sharing options...
newbie Posted November 19, 2007 Share Posted November 19, 2007 Hi open order-complete.tpl at the end place the following {literal} Google conversion code here {/literal} Thanks Paul The onepage (XML) versions does not use order-complete.tpl, it jumps from order-signup to viewinvoice and skipping order-complete.tpl. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted November 19, 2007 WHMCS CEO Share Posted November 19, 2007 The onepage (XML) versions does not use order-complete.tpl, it jumps from order-signup to viewinvoice and skipping order-complete.tpl. It doesn't matter what order form template is used, if you have it set to, it will show the order complete page at the end of the process. Matt 0 Quote Link to comment Share on other sites More sharing options...
newbie Posted November 20, 2007 Share Posted November 20, 2007 It doesn't matter what order form template is used, if you have it set to, it will show the order complete page at the end of the process. Matt This template is never shown. 0 Quote Link to comment Share on other sites More sharing options...
TerrasIOI Posted December 9, 2007 Share Posted December 9, 2007 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. Brianr, Have you succeeded to get this on line? I need this to. I have successfully set goals tracking, but that if not the same thing as tracking e-commerce transactions. I think that there can be easier solution. Because my setting of WHMCS redirect user to paid invoice automatically after payment, this form: <form style="display:none;" name="utmform"> <textarea id="utmtrans">UTM:T|[order-id]|[affiliation]| [total]|[tax]| [shipping]|[city]|[state]|[country] UTM:I|[order-id]|[sku/code]|[productname]|[category]|[price]| [quantity] </textarea> </form> can be added to invoice template instead - checkout tpl. I'm wondering if someone has tried this because it takes 24 hours for Analytics engine to show results. So before I spend the night with this it would be good to know. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted December 10, 2007 Share Posted December 10, 2007 I haven't done this (yet?) because I fear that should I elect to do that on the invoice page itself it could get multiple 'hits' and throw off Analytics. (If it uses the order-id as a dupe-prevention this might be moot -- donno.) I really want to do it as part of goal-conversion (perhaps in addition, if, again, duping the data is not a concern), however, I still don't have goal conversion working properly. I haven't been able to get a straight answer regarding the correct URL to use, and I'm about ready to give up the project. 0 Quote Link to comment Share on other sites More sharing options...
uberhost Posted December 10, 2007 Share Posted December 10, 2007 I haven't been able to get a straight answer regarding the correct URL to use, and I'm about ready to give up the project. Go to the templates directory and open the orderforms folder, then go into the appropriate folder (boxes, default, singlepage) and add your code to order-complete.tpl. Be sure to wrap the code in {literal}{/literal} tags. 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted December 10, 2007 Share Posted December 10, 2007 Yes, It's there -- however unless you don't redirect to the invoice on completion, it never shows. Also as far as goes go in Analytics the goal URL can depend (I think) on the payment type... I.E. PayPal never gets a ?step=complete URL... 0 Quote Link to comment Share on other sites More sharing options...
TerrasIOI Posted December 10, 2007 Share Posted December 10, 2007 Matt told me yesterday that this is not possible, so I guess that it is time to abandon this quest. 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted December 10, 2007 Share Posted December 10, 2007 Matt told me yesterday that this is not possible, so I guess that it is time to abandon this quest. That's very disappointing! 0 Quote Link to comment Share on other sites More sharing options...
newbie Posted December 17, 2007 Share Posted December 17, 2007 Matt told me yesterday that this is not possible, so I guess that it is time to abandon this quest. Are you sure, because I have a mail in which has written that it should be in the last order step, which is never been shown. There are also allot of people requesting him how it can be done. The page that shows the invoice (before payment) would be the next best thing. 0 Quote Link to comment Share on other sites More sharing options...
TerrasIOI Posted December 17, 2007 Share Posted December 17, 2007 That sounds logical to me too, but I'm pretty sure that Matt knows what he is talking about. 0 Quote Link to comment Share on other sites More sharing options...
brianr Posted December 17, 2007 Share Posted December 17, 2007 Matt, *Please* - could you hop in and clarify if what we want can be done -- or if some changes could be implemented in a future version to do it? 0 Quote Link to comment Share on other sites More sharing options...
newbie Posted December 29, 2007 Share Posted December 29, 2007 Matt, *Please* - could you hop in and clarify if what we want can be done -- or if some changes could be implemented in a future version to do it? 2bad after months no answer on this issue. 0 Quote Link to comment Share on other sites More sharing options...
ddh Posted February 22, 2008 Share Posted February 22, 2008 How do we add this as a feature request? 0 Quote Link to comment Share on other sites More sharing options...
TerrasIOI Posted February 22, 2008 Share Posted February 22, 2008 I think, but I'm not sure, that with v3.6 logic this is possible now. Maybe Matt can confirm or deny. Regards. 0 Quote Link to comment Share on other sites More sharing options...
paradoxic Posted July 16, 2010 Share Posted July 16, 2010 Is this something we can do yet? It would be a major help to be able to track this. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.