Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1160825

    Hello, I need to insert this code in my website header. And I don´t know how to do it.

    :
    window.addEventListener(“DOMContentLoaded”, function() {
    // Evento de Click en Telefono
    document.querySelectorAll(“a[href^=’tel:’]”).forEach((button) => {
    button.addEventListener(‘click’, () => {
    ga(‘send’, ‘event’, ‘Telefono’, ‘Click’, document.title);
    });
    });
    // Evento de Click en Email
    document.querySelectorAll(“a[href^=’mailto:’]”).forEach((button) => {
    button.addEventListener(‘click’, () => {
    ga(‘send’, ‘event’, ‘Email’, ‘Click’, document.title);
    });
    });
    // Evento de Envio de Formulario
    var sentOK = false;
    var targetNode = document.querySelector(‘.wpcf7-response-output’);
    var observer = new MutationObserver(function(){
    if(targetNode.classList.contains(“wpcf7-mail-sent-ok”)&&sentOK==false){
    ga(‘send’, ‘event’, ‘Formulario’, ‘Envio’, document.title);
    sentOK = true;
    }
    });
    observer.observe(targetNode, { attributes: true, childList: true })
    }, false);

    #1160998

    ?

    #1161403

    Hi,

    You will need to open the header.php file and paste the code there.

    Best regards,
    Basilis

    #1162680

    where do i find header php file?

    #1162706

    and what about using Header Footer Code Manager?

    #1162808

    Hi,

    The header.php file is located in the root folder of the theme. You could try using a plugin like you mentioned as well.

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.