Els meus amics rebran un cop d’ull, ja que poques vegades responc al meu telèfon ... però vaja ... es tracta d’ajudar seva companyia, no la meva! Amb l'augment enorme d'iPhone, Android i altres telèfons intel·ligents, realment és hora que comenceu a optimitzar el vostre lloc per utilitzar-lo en un navegador mòbil.
Les empreses veuen que una part important dels seus visitants arriba a través de dispositius mòbils. Tenir un lloc web responsiu que tingui un aspecte fantàstic en un dispositiu mòbil ja no és una opció, és una necessitat.
Aquí hi ha una cosa que sovint es passa per alt quan es crea una experiència mòbil... enllaçant els vostres números de telèfon perquè els usuaris mòbils només puguin fer-hi clic i iniciar una trucada. La sintaxi és bastant simple:
13172039800
Un típic etiqueta d'ancoratge amb un enllaç web utilitza un URL en el valor, s’utilitza un enllaç de correu electrònic mailto... la sintaxi d'un número de telèfon és simplement tel. He provat el valor amb i sense parèntesis, punts i guions i sembla que tot funciona tant a l'iPhone com a Droid. Tanmateix, recomano incloure el codi del país al número de telèfon i eliminar tots els guions, espais o punts del valor href.
Si voleu mesurar quantes persones fan clic en aquests enllaços, podeu llegir el nostre article sobre com fer-ho afegir un esdeveniment de Google Analytics mitjançant el Gestor d'etiquetes de Google.
Genius Doug! Plan to start using that on all of my client sites. Okay if I post this on my blog? Of course giving you full authorship. Very cool! 😎
So is there any reason NOT to put parentheses, periods, or dashes in a phone number? And does the html phone number act like a title tag? Is there any SEO benefit to doing a title tag within the href code?
@edeckers The RFC3966 standard doesn’t appear to support parenthesis but do support a ton of other options and symbols for international calling, extensions, etc:
http://www.ietf.org/rfc/rfc3966.txt
As for SEO, I don’t see why not! Perhaps the business name + “phone number” could be a good way to implement!
Hi, that’s a cool trick but I tried this and Firefox gave me an ugly error message saying it didn’t know how to read the link. To me, it isn’t worth an ugly error message when someone clicks the link on a desktop just to have a mobile phone be able to access the link. “Long-press” on the phone number on Android and it automatically tries to call a number anyways. Am I wrong? Is there a work around?
It’s definitely targeted to the mobile user, In House.
You can always avoid that by browser detection. Put it in a div that is hidden for non-mobile/larger resolution browsers.
Thanks for this referrer post Doug:)
Thank you so much. simple like you said, yet efficient. You can go a couple steps further and make it link to an icon and create a title in the anchor tag to display your phone number and further instructions for users who hover their mouse over the icon. Thanks again!
can we also add text to the hyperlink phone number?
I believe the href variable only allows numbers… however, you could put whatever text you’d like within the anchor tag itself.
This is a great trick! I am going to start adding this to sites from now on. Thanks!
I’m not 100% sure (and I know this is a pretty old discussion so this might not be relivent) but don’t most smartphones these days automatically do this now?
@facebook-502306174:disqus many do, but many also format the number incorrectly unless you define it.
Gràcies.
Just a simple correction … you said you recommend we “keep everything but the actual numbers IN the href value”
I’m sure you mean “keep everything but the actual numbers OUR OF the href value”
Or else you’d just be dialing a bunch of punctuation 🙂
Thanks Brian!
Thanks Douglas, What is the Social Media Bar you are using? Your blog looks great and you have a lot of great content. Would love to connect on Google Plus. Thanks again
Thanks Dean! After much searching around the net for a great solution, I landed on Shareaholic. It has a ton more features that we don’t use – but it’s very flexible!
I still don’t know from this column, how to email a phone number – to a cell phone, so my boss can just tap it and call.
Hi Dee, your email software would need to support HTML and the ability to add the hyperlink we describe above. This article was more about how to do this on a mobile website, not an email.
Hi Douglas, how well does this work for international callers? Do you think it’s best to use an international (e.g. +44) number, or a local area code?
To be honest, Ben, I believe it works flawlessly. I believe many international callers use local area codes. Nigeria scam artists immediately come to mind. 🙂
Hi, Can a hashtag be used as a hyperlink to start a phone call? I heard it mentioned the other day but have not seen it. Thank you!
I’ve not seen this yet. I suppose you could write some kind of plugin or script, but it’s not a native HTML function.
How do I create a “call now” button in an email marketing program such as Microsoft Publisher? Also how would I put it into mailchimp?
So I do not need to include – or . between the numbers? Also, how would you include an extension so the hyperlink will call the extension directly?
Within the href value, you don’t want any dashes or dots between the numbers. Within the anchor text, you can write anything.
Great article – very helpful. Thanks!
Great Article.
Hi Douglas, Thanks so much for sharing this code.
Great tip Doug! Thank you. This article is more relevant, 6 years later with everything going mobile.
Funciona!! Gràcies Doug !! 😉
Gràcies per la teva ajuda!
Very informative tutorial! Actually, I like the aspect of a “click to call widget” instead of a “clickable phone number” better. Having tried out the Callback Tracker plugin on my site, I see a lot more results with the ability to call my leads, instead of having them call me. Personally, I see it as necessary on most sites. Here is the link to plugin https://callbacktracker.com/plugins/wordpress-click-to-call-plugin-install-tutorial/
Molt xulo, gràcies per compartir!