开发者

tracking click-to-call mobile feature

开发者 https://www.devze.com 2023-03-11 06:21 出处:网络
I have a simple wordpress/php landing page with a click-to-call link: <a href=\"tel:888-555-7777\" target=\"_self\">888-555-7777</a>

I have a simple wordpress/php landing page with a click-to-call link:

<a href="tel:888-555-7777" target="_self">888-555-7777</a>

When that link is clicked on a mobile phone, a dialog box opens and asks the开发者_开发技巧 user if she want to make the call. Clicking "yes" dials the number.

My question is two folds:

  1. How can I track the number of users who clicked on that link?
  2. How can I track the number of users who clicked "yes" on the dialog box.

number 1 is of higher priority to me than number 2.

Thanks in advance.


If you use the async Google Analytics code on your website, the following JavaScript should help with the first part of your question. Code sample requires jQuery.

// Select the links that start with "tel" in their href
$("a[href^=tel]").each(function(){
    $(this).click(function(e){
        // Use Google Analytics to track this click
        _gaq.push([ '_trackEvent', 'Telephone Link', 'click', this.href ]);
    });
});

I'm not sure if the second part is traceable though.


  1. just add a onclick event handler. Use ajax to send the click-info to the server.
  2. you can probably detect if the user clicked 'no'. Set a timeout of about 2 seconds. If the event fires the user is still on the page, so it must have clicked 'no'. This should work on iPhone, not sure about android,blackberry,etc. Maybe you also have to store the time of click, just in case the timeout fires once the user returns to the page after the call.


Another simple way to have your stats would be using your own VoIP server. So you could see all calls in the VoIP statistics.

0

精彩评论

暂无评论...
验证码 换一张
取 消