Jump to content

Integrate WHMcs with KISSmetrics


Juanzo

Recommended Posts

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>

Link to comment
Share on other sites

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 by WHMCS JamesX
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by factor
Tested and working
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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