Juanzo Posted January 10, 2013 Share Posted January 10, 2013 For those who never heard of it, KISSmetrics is a paid alternative to Google Analytics to focus on the proper metrics. In order to properly use it, the platform needs to identify each client and generate events each time a client does specific actions like buying a hosting plan. Their javascript libraries explain how to integrate it but I have some specific questions from the WHMcs side. For example, to identify users they use: <script type="text/javascript"> _kmq.push(['identify', 'name@email.com']); </script> How can I print that at the WHMcs template, to replace it with the proper client if logged in? Also I'd love to at least track new clients using: <script type="text/javascript"> _kmq.push(['record', 'Signed Up', {'Plan':'Pro', 'Amount':99.95}]); </script> 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Chris Posted January 10, 2013 Share Posted January 10, 2013 Typically you would add this type of code to a page that's constantly loaded, like footer.php or header.php. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS JamesX Posted January 10, 2013 Share Posted January 10, 2013 (edited) You can use something similar to this: {if $loggedin}<script type="text/javascript"> _kmq.push(['identify', '{$clientemail}']); </script>{/if} With that said, if you can use something other than their e-mail address as the identifier, I'd suggest their client ID. The e-mail can change, but the ID won't though. Edited January 10, 2013 by WHMCS JamesX 0 Quote Link to comment Share on other sites More sharing options...
Juanzo Posted January 10, 2013 Author Share Posted January 10, 2013 Thanks Chris, indeed I'm placing KISSmetrics tracking at the header, right after head and these 2 tracking code at the footer. That looks great James, but I've tested it and looking at the source code, it prints empty: <script type="text/javascript"> _kmq.push(['identify', '']); </script> Any idea on why something like this could happen? 0 Quote Link to comment Share on other sites More sharing options...
factor Posted January 11, 2013 Share Posted January 11, 2013 (edited) Thanks Chris, indeed I'm placing KISSmetrics tracking at the header, right after head and these 2 tracking code at the footer. That looks great James, but I've tested it and looking at the source code, it prints empty: <script type="text/javascript"> _kmq.push(['identify', '']); </script> Any idea on why something like this could happen? Hi, this is the code that works, it has to use literal tags so code is processed correctly: {if $loggedin} {literal} <script type="text/javascript"> _kmq.push(['identify','{/literal}{$clientsdetails.id}{literal}']); </script> {/literal} {/if} I'm starting with kissmetrics today, we can collaborate on integration code and suggestions ;-) Regards, Edited January 11, 2013 by factor Tested and working 0 Quote Link to comment Share on other sites More sharing options...
Juanzo Posted January 11, 2013 Author Share Posted January 11, 2013 Genial factoriadigital, gracias! I've ended up using the following code, so I can identify clients by their email for the time being. {if $loggedin} {literal} <script type="text/javascript"> _kmq.push(['identify','{/literal}{$clientsdetails.email}{literal}']); </script> {/literal} {/if} Now to be able to track orders, I believe we'll need something like this: {literal} <script type="text/javascript"> _kmq.push(['record', 'Contratacion', {'Plan':'Pro', 'Amount':{/literal}{$amount}{literal}}]); </script> {/literal} Any clue what variable should we use to print the service name replacing Pro? I'll test it out and report back. 0 Quote Link to comment Share on other sites More sharing options...
altomarketing Posted January 12, 2013 Share Posted January 12, 2013 che Juan, vale la pena ? Mejora la productividad o analisis con esto? 0 Quote Link to comment Share on other sites More sharing options...
Juanzo Posted January 13, 2013 Author Share Posted January 13, 2013 Configuring this might be harder than I though and KISSmetrics team is already advicing to use their API: You could streamline the event creation process through the use of our API. Otherwise, you will create each event one by one. In terms of tracking events for a SaaS environment, I would suggest taking a look at this document: http://support.kissmetrics.com/best-practices/saas-essentials If there are other people interested, we could crowfund this integration. @altomarketing: Definitivamente si, churn rate y customer lifetime value son 2 de las métricas mas importantes para cualquiera que ofrezca un servicio. 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.