# Tracking code on landing page - GrapeJS builder

**URL:** <https://forum.mautic.org/t/tracking-code-on-landing-page-grapejs-builder/23047>\
**Category:** Ideas and Feature Requests\
**Created:** [March 15, 2022, 8:30am UTC](https://forum.mautic.org/t/tracking-code-on-landing-page-grapejs-builder/23047 "2022-03-15T08:30:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [March 15, 2022, 8:30am UTC](https://forum.mautic.org/t/tracking-code-on-landing-page-grapejs-builder/23047/1 "2022-03-15T08:30:06Z")

</div>

Hello all,

My idea is: allow the addition of a Javascript tracking code (Google Ads, Facebook Ads) on a specific landing page.

The forms this can take:

- add a GrapeJS module to add Javascript code
- add a section in the configuration part of Mautic to add a tracking code on one or more landing pages
- add a shortcode management in Mautic

I think these groups of people would benefit from this idea: anyone who needs to track conversions during an advertising campaign

Pierre

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 15, 2022, 3:42pm UTC](https://forum.mautic.org/t/tracking-code-on-landing-page-grapejs-builder/23047/2 "2022-03-15T15:42:05Z")

</div>

As far as I know you can sdd html (Js) to landing pages since 4.2

---

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [March 15, 2022, 4:59pm UTC](https://forum.mautic.org/t/tracking-code-on-landing-page-grapejs-builder/23047/3 "2022-03-15T16:59:09Z")

</div>

@joeyk Thank you for your feedback. Do you have the procedure for this?

Currently when I add GrapeJS code I modify it so that it is not interpreted.

Pierre

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 16, 2022, 10:42am UTC](https://forum.mautic.org/t/tracking-code-on-landing-page-grapejs-builder/23047/4 "2022-03-16T10:42:26Z")

</div>

Check this:

> <https://github.com/mautic/mautic/pull/9695>
>
> | Q | A
> | --------------------------------…------ | ---
> | Branch? | features
> | Bug fix? | no
> | New feature? | yes
> | Deprecations? | no
> | BC breaks? | no
> | Automated tests included? | yes
> | Related user documentation PR URL | N/A
> | Related developer documentation PR URL | N/A
> | Issue(s) addressed | N/A
> 
> \<!--
> Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#step-5-work-on-your-pull-request):
> - Always add tests and ensure they pass.
> - Bug fixes must be submitted against the lowest maintained branch where they apply
> (lowest branches are regularly merged to upper ones so they get the fixes too.)
> - Features and deprecations must be submitted against the "features" branch.
> \--\>
> 
> \<!--
> Please write a short README for your feature/bugfix. This will help people understand your PR and what it aims to do.
> \--\>
> \#### Description:
> 
> Added two new fields for landing page:
> \* Script inside head
> \* Script inside footer
> 
> Anyone with this feature can add custom script to single landing page, and can decide whether to upload it if inside head tag or at the end of body.
> 
> !\[singlelandingscripts\](https://user-images.githubusercontent.com/50916237/109322676-dcae6480-7852-11eb-8c95-7c68de8c03df.png)
> 
> 
> \<!--
> If you are fixing a bug and if there is no linked issue already, please provide steps to reproduce the issue here.
> \--\>
> 
> \#### Steps to test this PR:
> 1. Load up \[this PR\](https://mautibox.com)
> 2. Create a landing page
> 3. Edit the two new inputs with a custom script (example \`\<script\>console.log("Hello world");\</script\>\`)
> 4. Go to the landing page and check if script is loaded
> 
> \<!--
> If you have any deprecations, list them here along with the new alternative.
> If you have any backwards compatibility breaks, list them here.
> \--\>
> 
> 
> \<a href="https://gitpod.io/#https://github.com/mautic/mautic/pull/9695"\>\<img src="https://gitpod.io/button/open-in-gitpod.svg"/\>\</a\>
