Created
April 24, 2023 04:01
-
-
Save wp126/e3536125a57d661621e018b93511cab4 to your computer and use it in GitHub Desktop.
google anyalytice event and facebook pixel on contact form 7
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
<!-- Meta Pixel Code --> | |
<script> | |
!function(f,b,e,v,n,t,s) | |
{if(f.fbq)return;n=f.fbq=function(){n.callMethod? | |
n.callMethod.apply(n,arguments):n.queue.push(arguments)}; | |
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; | |
n.queue=[];t=b.createElement(e);t.async=!0; | |
t.src=v;s=b.getElementsByTagName(e)[0]; | |
s.parentNode.insertBefore(t,s)}(window, document,'script', | |
'https://connect.facebook.net/en_US/fbevents.js'); | |
fbq('init', '1655166718268702'); | |
</script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=G-YYHR65SGCP"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'G-YYHR65SGCP'); | |
</script> | |
<!-- End Meta Pixel Code --> | |
<a href="" class="asdfafa">asdfaf</a> | |
<script type="text/javascript"> | |
jQuery( document ).ready(function() { | |
console.log( "ready!" ); | |
jQuery(".asdfafa").click(function(){ | |
console.log( "ready!" ); | |
gtag( 'event', 'wpcf7_submissiongf', { | |
'event_category': 'ddd', | |
'event_label': 'ddd' | |
} ); | |
fbq('track', 'Lead', { | |
content_name: 'asfdaf John Smith' | |
}); | |
return false; | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment