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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.