![]() Or perhaps you share content creation responsibilities and just want a surefire solution to catch mistakes that other people might make. Perhaps you have a client that you can support through Google Tag Manager, but that you can’t make any direct changes to content. We may have way too many pages to check every one, or we may have dynamic content that we don’t control. Unfortunately, sometimes we don’t have the option of manually correcting all of our phone numbers. If you can currently format all of the phone numbers like this on your website reliably, then it may be as easy as adding in some javascript to look for those perfectly formatted phone links. This blog post is geared towards North American styled telephone numbers, but feel free to adapt it as needed! If you deal with international audiences, the + before the country code is important, though the plus sign is not necessary for in-country calling. Some desktop sites will use “callto:” which works with Skype and other companies. For most mobile browsers, this will allow a user to click directly on your link, which will initiate a phone call to that number. To summarize the debate quickly, if you’re using a telephone number on a mobile website, the most common way is to wrap phone numbers like so: 1 (412) 381-5500. For this post, I’m only going to focus on mobile devices. There are lots of opinions out there about the best way to write a telephone number on a website. If you’re just looking for the code – click here for the javascript.įor this demonstration, I’ll use our office number: 1 (412) 381-5500. ![]() ![]() As if that’s not enough, dealing with different browsers on different devices supremely complicates the matter.įear not, through the power of javascript and regular expressions, we can certainly tackle this! This post gets a little long, but I wanted to explain why I made all of the decisions that I did. However, phone numbers can be written in many, many different ways and we don’t always have control over the content to add in appropriate phone tags. Sometimes when dealing with a website, it’s easy to throw on the classic tracking events – PDFs, mailto links, etc… But what if we wanted to track when people clicked on our phone links? In a perfect world, this should be easy. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |