Skip to content

Commit

Permalink
Add sample script for debugging during development
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Dec 17, 2024
1 parent 70909be commit ee63ad2
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,45 @@ We use [Composer](https://getcomposer.org) for managing PHP development dependen
## Screenshot

![Contact Form 7 Controls](screenshot-1.png)

## Sample Analytics Scripts

Note: all scripts use a fake account ID `abc123`.

Google Tag Manager (GTM):

```html
<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=
'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):

```html
<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:

```html
<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>
```

0 comments on commit ee63ad2

Please sign in to comment.