Im sure there is a simple explanation to this but I cant find an answer to this anywhere. This is a function that is called on the header to display phone number. Im trying to add the click-to-call tracking to this but when I add it, it breaks the site. So
This is the current code:
function themeblvd_header_contact() {
$link_address = 'tel:3026560214';
echo "<div class='contact-number'>Contact us at <a href='$link_address'>(302) 656-0214</a></div>";
}
When I add the click-to-call is when it breaks:
$link_address = 'tel:3026560214';
echo "<div class='contact-number'>Contact us at <a onclick="ga('send', 'event',
'phone number', 'click to call', '3026560214', 1);" href='$link_address'>(302) 656-0214</a></div>";