Source of the Contact Form 7 Controls plugin for WordPress.
Support the continued development of this plugin by pre-ordering the PRO version that will include advanced analytics and tracking features. Learn more →
Search for "Contact Form 7 Controls" under "Plugins → Add New" in your WordPress dashboard.
Install as a Composer dependancy:
composer require kasparsd/contact-form-7-extras
We use Composer for managing PHP development dependencies while Node.js is used for most scripting needs, building the plugin release and deploying to WP.org via @wpelevator/wp-release with changesets-driven release pull requests.
-
Clone the plugin repository:
git clone https://github.com/kasparsd/contact-form-7-extras.git -
Setup the development environment and tools:
npm install composer install -
Build a release ZIP of the plugin:
npm run zip
Note: all scripts use a fake account ID abc123.
Google Tag Manager (GTM):
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-abc123');</script>Google Analytics 4 (gtag.js):
<script async src="https://www.googletagmanager.com/gtag/js?id=G-abc123"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-abc123');
</script>Facebook Pixel:
<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', 'abc123');
</script>