# Javascript code snippet injection for cookie tracking

**URL:** https://meta.discourse.org/t/javascript-code-snippet-injection-for-cookie-tracking/185851
**Category:** Support
**Created:** [April 7, 2021, 9:24am UTC](https://meta.discourse.org/t/javascript-code-snippet-injection-for-cookie-tracking/185851 "2021-04-07T09:24:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![allergysnap2020](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@allergysnap2020](https://meta.discourse.org/u/allergysnap2020)
#### Post date: [April 7, 2021, 9:24am UTC](https://meta.discourse.org/t/javascript-code-snippet-injection-for-cookie-tracking/185851/1 "2021-04-07T09:24:09Z")

</div>

I am trying to have the following script added to our community site so we can get comprehensive cookie tracking.

This needs to be added to the page in the .

Can anyone help me get this configured in discourse setting?

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 7, 2021, 10:32am UTC](https://meta.discourse.org/t/javascript-code-snippet-injection-for-cookie-tracking/185851/2 "2021-04-07T10:32:13Z")

</div>

Hey there,

I think you might have mis-filed this under #Support > WordPress instead of #Support, but no worries. You need to add the script to the `head` section of your theme. For this, and more on how to configure your theme, see

> [@Beginner's guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966):
>
> This is a crash course in Discourse theme basics. The target audience is everyone who is not familiar with Discourse themes. If you’ve already used Discourse theme / theme components, this guide is probably not something you need to read. What are themes and theme components? A theme or theme component is a set of files packaged together designed to either modify Discourse visually or to add new features. Let’s start with themes. Themes In general, themes are not supposed to be compatible …

---

<div class="post-metadata">

### Author: ![allergysnap2020](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@allergysnap2020](https://meta.discourse.org/u/allergysnap2020)
#### Post date: [April 8, 2021, 7:03am UTC](https://meta.discourse.org/t/javascript-code-snippet-injection-for-cookie-tracking/185851/3 "2021-04-08T07:03:51Z")

</div>

![Screen Shot 2021-04-08 at 3.56.28 PM](https://global.discourse-cdn.com/meta/original/3X/b/b/bb5e84bf82f826ac981d5cfcde9f895b5ee5206f.png)

I copied and paste in the component section and added it to the theme.  
Is this expected setup? Thanks

 ![Screen Shot 2021-04-08 at 4.03.12 PM](https://global.discourse-cdn.com/meta/original/3X/6/d/6daa2b9fbaa5abd5eeeb8e8c284225eb1ad2ccf9.png)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 8, 2021, 8:23am UTC](https://meta.discourse.org/t/javascript-code-snippet-injection-for-cookie-tracking/185851/4 "2021-04-08T08:23:47Z")

</div>

> [@allergysnap2020](#):
>
> I copied and paste in the component section and added it to the theme.

Yes, that’s right 👍
