Shoora
10/8/2018 - 4:47 PM

Vanilla js

Vanilla js

function convert(name) {
    if (!ga) return;
    var tracker = ga.getAll()[0];
    tracker.send("event", name);
}
document.addEventListener('wpcf7submit', function (event) {
    convert(event.detail.contactFormId);
});
document.querySelector('a[href^="tel:"]').onclick = function () {
    convert('clicked-call')
};
document.querySelector('a[href^="mailto:"]').onclick = function () {
    convert('email-link')
};