Adding GoogleTags code in Action bar & Contact box

Hi 
i need to add this Googletag code around the telephone number in the action bar and on the contact box on the contact us page. 

<a onclick="return gtag_report_conversion('tel:07767112990');" href="tel:07767112990">07767112990</a>

This code needs to be placed around the email address on the contact box on contact page


<a onclick="return gtag_report_conversion('mailto:[email protected]');" href="mailto:[email protected]">[email protected]</a>


adding these codes to the options or element just displays the code on the front end. Could you provide a way to add this code please

The website is invigorate-training.co.uk

Thanks in advance

Comments

  • Hi,
    due to Envato new security changes which we have to follow. From now on
    you cannot use HTML markup in most of Theme options. Fields that
    previously accepted HTML now only accept plain text.
    Only basic HTML tags like strong and u are working. Read more about the changes here:
    https://help.author.envato.com/hc/en-us/articles/360000481243-WordPress-Theme-Security-Requirements#h_674316188621522302914837

    It's not possible to add <a> tag in the Action Bar.
    All HTML code should be inserted in the Column item.
    Thanks
  • Hi Pablo,
    I understand i would usually use the column to add html i am trying to hardcode these changes as they are not areas that will be changed regulary. 
    I found the 2 php files i need to edit, header-top-area.php and theme-shortcodes php but could seem to add the code to the php files with out the page not loading.

    From header-top-area.php
    if ($header_phone = mfn_opts_get('header-phone')) {
    echo '<li class="phone"><i class="icon-phone"></i>
    <a href="tel:'. esc_attr(str_replace(' ', '', $header_phone)) .'">'. esc_html($header_phone) .'</a></li>';
    }

    Code to insert
    <a onclick="return gtag_report_conversion('tel:07767112990');" href="tel:07767112990">07767112990</a>

    from theme-shortcodes.php

    if ($telephone) {
    $output .= '<li class="phone phone-1">';
    $output .= '<span class="icon"><i class="icon-phone"></i></span>';
    $output .= '<p>
    <a href="tel:'. esc_attr(str_replace(' ', '', $telephone)) .'">'. esc_html($telephone) .'</a></p>';
    $output .= '</li>';
    }


    if ($email) {
    $output .= '<li class="mail">';
    $output .= '<span class="icon"><i class="icon-mail"></i></span>';
    $output .= '<p><a href="mailto:'. esc_attr($email) .'">'. esc_html($email) .'</a></p>';
    $output .= '</li>';
    }

    CODE TO ADD TO TEL

    <a onclick="return gtag_report_conversion('tel:07767112990');" href="tel:07767112990">07767112990</a>

    CODE TO ADD TO EMAIL

    <a onclick="return gtag_report_conversion('mailto:[email protected]');" href="mailto:[email protected]">[email protected]</a>
  • Sorry, but we do not help with theme files customization.
    So if you want to modify files and don't know how, you should contact your web developer.
    Thanks
Sign In or Register to comment.