This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul { | |
padding-left: 0; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
var form = event.target.querySelector( 'input[name="_wpcf7"]' ).getAttribute("value"); | |
if( parseInt( form ) == 4839 ) { | |
gtag('event', 'form_submit', { | |
event_category: 'Forms', | |
event_action: 'Submit', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const emailLinks = document.querySelectorAll('a[href^="mailto:"]'); | |
emailLinks.forEach(function(emailLink){ | |
emailLink.addEventListener('click', () => { | |
gtag('event', 'link_click', { | |
event_category: 'Links', | |
event_action: 'Click', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const phoneLinks = document.querySelectorAll('a[href^="tel:"]'); | |
phoneLinks.forEach(function(phoneLink){ | |
phoneLink.addEventListener('click', () => { | |
gtag('event', 'link_click', { | |
event_category: 'Links', | |
event_action: 'Click', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const form = document.getElementById('my_form'); | |
form.addEventListener('submit', function(event){ | |
gtag('event', 'form_submit', { | |
event_category: 'Forms', | |
event_action: 'Submit', | |
event_label: 'Test form' // Name of your form. | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gtag('event', 'page_view', { | |
page_title: 'Page title', | |
page_location: location.href, | |
page_path: location.pathname | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Replace this config call */ | |
gtag('config', 'XX-YOURID-X'); | |
/* With this call */ | |
gtag('config', 'XX-YOURID-X', { | |
send_page_view: false | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=XX-YOURID-X"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'XX-YOURID-X'); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li>Lorem ipsum dolor sit.</li> | |
<li>Cupiditate fugit iste voluptates!</li> | |
<li>Laudantium quas saepe voluptatum.</li> | |
<li>Dolorem minima officiis quis!</li> | |
<li>Doloribus expedita magni quisquam.</li> | |
</ul> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li>Lorem ipsum dolor sit.</li> | |
<li>Cupiditate fugit iste voluptates!</li> | |
<li>Laudantium quas saepe voluptatum.</li> | |
<li>Dolorem minima officiis quis!</li> | |
<li>Doloribus expedita magni quisquam.</li> | |
</ul> | |
<style> |