• Skip to main content
  • Skip to primary sidebar

Victor Font Consulting Group, LLC

The DEX Intranet Specialists

  • Home
  • Care Plans
    • Care Articles
    • Optional Subscriptions
  • Consultations
  • Products
    • Code Snippets
    • Public GitHub Repositories
    • Gist Snippets
    • Pastebin Snippets (Free)
    • Free Plugins
  • FAQs
  • Support
    • Graphic Design
  • Contact
    • Speakers
    • Portfolio
  • Resources
    • Free WordPress Video Training
    • Tutorials
    • Articles
    • Cybersecurity
    • EU Referral Network

AdWords Call Tracking for Genesis Themes

November 10, 2015 By Victor M. Font Jr.

AdWords Call Tracking for Genesis Themes, public domain image from pixabay.com

Tracking phone calls generated from your website is an important metric. How else will you learn how effective your ads are in leading to phone calls from your website that ultimately lead to conversions? Granted, not every call that comes from a website is the result of an ad. Many calls are organic, meaning they've been driven by the site itself and the content you publish. Regardless of the vehicles that lead to a phone call, it's still nice to know how many of those calls result from a click through on your website.

With the addition of Google AdWords Call tracking to your site, you can track calls that originate from your site or mobile devices. The instructions for adding the Google AdWords tracking code to your site are pretty straightforward. Straightforward, that is, if you have a plain vanilla, generic type of website. If you are using a professional developers' tool like the Genesis Framework, Google's instructions may not apply to you. We've written this article to help you install the Google AdWords call tracking code into your Genesis based child theme.

First Method—Don't Try This at Home

One way of attempting to add the code is with the genesis_attr_body filter:

As simple as it is, the problem with the above code is that it doesn't work. When passed through the filter, it does indeed add the AdWords function to the <body> tag. However, it also sanitizes the code and converts the required single quotes within the function into their respective HTML entities (&039). So the resulting HTML looks like this:

It's not very pretty. It definitely won't work. And we haven't been able to find a work-around.

Second Method—JavaScript

While we're not going to repeat anything you can already learn from the Google AdWords Call Tracking site, one thing their site omits is the fact that you can install their function with a JavaScript snippet. The function below is added to your site's header area. In Genesis you can do this in several ways. You can navigate to the Genesis/Theme Settings admin page and copy the code into the header script meta box. You can also add the code through the Genesis Simple Hooks plugin. Or last, you can create code to add the script through your functions.php file.

Third Time's the Charm

The third method, and the one that we prefer, is to add the code directly to header.php. Genesis child themes typically do not have a custom header.php. Header.php is found in the Genesis directory. Since this is core code, you must not under any circumstances edit this file directly. Doing so will create a multitude of problems for you when the Genesis Framework is updated. You can, however, copy header.php into the root folder of your child theme and then edit that file. The code below is an edited header.php from Genesis Version 2.2.3 that you can copy and paste into the child theme directory. Lines 21 and 22 show the modifications. Change the number to your own.

Also note that future versions of Genesis may render this code obsolete. We'll do our best to keep this code updated as new versions of the framework are released.

  • 2shares
  • Facebook0
  • Twitter0
  • Pinterest0
  • LinkedIn2
  • Print
  • SMS0

Filed Under: Code Snippet, Genesis, Programming, SEO, WordPress Tagged With: Code Snippet, Genesis, Programming, SEO, WordPress

About Victor M. Font Jr.

Victor M. Font Jr. is an award winning author, entrepreneur, and Senior IT Executive. A Founding Board Member of the North Carolina Executive Roundtable, he has served on the Board of Advisors, of the North Carolina Technology Association, the International Institute of Business Analysis, Association of Information Technology Professionals, Toastmasters International, and the North Carolina Commission for Mental Health, Developmental Disabilities, and Substance Abuse Services. He is author of several books including The Ultimate Guide to the SDLC and Winning With WordPress Basics, and Cybersecurity.

Primary Sidebar

Shopping Cart

Books

  • Ultimate Guide to the SDLC front cover The Ultimate Guide to the SDLC
    Rated 5.00 out of 5
    $74.95
  • Winning With WordPress Basics 2nd Edition Winning With WordPress Basics 2nd Edition $19.95

Recent Articles

  • Modern Scam Defense: How Consumers and Businesses Can Recognize and Stop Email, Phone, and Text Fraud
  • How to Write a PRD So Dense It’s Technically a Novel
  • Top 5 Plugin Names That Scare Our Legal Department
  • When Agile Meets Our 3-Year Waterfall Roadmap: A Love Story
  • Why Our Enterprise Needs 27 Stakeholders to Approve a Button Color Change

Top 10 Article Categories

Best Practice Code Snippet Computers and Internet Genesis How To Leadership Programming Servant Leadership Tutorial WordPress

 
We only use analytical cookies on our website that allow us to recognize and count the number of visitors, but they do not identify you individually. They help us to improve the way our website works. By clicking Accept you, agree to cookies being used in accordance with our Cookie Policy.