# Disable automatic tracking from a Landing Page set as the Mautic 404 Page

**URL:** <https://forum.mautic.org/t/disable-automatic-tracking-from-a-landing-page-set-as-the-mautic-404-page/23143>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [March 20, 2022, 7:50pm UTC](https://forum.mautic.org/t/disable-automatic-tracking-from-a-landing-page-set-as-the-mautic-404-page/23143 "2022-03-20T19:50:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamjrock](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamjrock/32/7127_2.png) [@iamjrock](https://forum.mautic.org/u/iamjrock)\
**Post date:** [March 20, 2022, 7:50pm UTC](https://forum.mautic.org/t/disable-automatic-tracking-from-a-landing-page-set-as-the-mautic-404-page/23143/1 "2022-03-20T19:50:31Z")

</div>

**Your software**  
My Mautic version is: 4.2  
My PHP version is: 7.4.3  
My Database type and version is: MariaDB 10.6

**Your problem**  
Mautic config offers the option to select a Landing Page to render as Mautic’s 404 response instead of Mautic’s default 404 page.

However, Landing Pages have the tracking javascript **automatically** applied to them. We’d like to be able to use a custom 404 page (Landing Page) without any tracking.

Is there any way to disable the tracking script on these 404 landing pages?

**These errors are showing in the log:** n/a

**Steps I have tried to fix the problem:**  
Override Mautic’s 404 page with a static page at the webserver / reverse proxy level. We can do this, but it seems expensive given that mautic will have rendered a 404 page response anyway.

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [March 20, 2022, 9:55pm UTC](https://forum.mautic.org/t/disable-automatic-tracking-from-a-landing-page-set-as-the-mautic-404-page/23143/2 "2022-03-20T21:55:31Z")

</div>

Looking over the options in 4.2.0 there is an option for anonymous contacts:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cf2e04a2ba6831ee588c08b9103c69abc08d9b70.png)

I guess the identified leads would still be tracked if they visited page with 404 status. If you want to exclude those as well I think you would have to adjust the code.

I would investigate where in the core is this option for anonymous contacts used and then try to adjust the logic to apply to all the contacts.

---

<div class="post-metadata">

**Author:** ![iamjrock](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamjrock/32/7127_2.png) [@iamjrock](https://forum.mautic.org/u/iamjrock)\
**Post date:** [March 21, 2022, 5:48am UTC](https://forum.mautic.org/t/disable-automatic-tracking-from-a-landing-page-set-as-the-mautic-404-page/23143/3 "2022-03-21T05:48:16Z")

</div>

Thx @mzagmajster,

That’s a good point. This setting will prevent 404 page hits by anonymous contacts being recorded in the database.

Looking at the code though, _I think_ every 404 page hit event will still be posted to the mautic server for parsing of this rule.

What I’d prefer is that the js Tracking Script is simply not automagically included on 404 Landing Pages and thus no event is sent to Mautic.

Can anyone see a way to achieve that?

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [March 21, 2022, 1:03pm UTC](https://forum.mautic.org/t/disable-automatic-tracking-from-a-landing-page-set-as-the-mautic-404-page/23143/4 "2022-03-21T13:03:35Z")

</div>

Hi,

I have not tried this myself but maybe you can modify tracking script by subscribing to CoreEvents::BUILD\_MAUTIC\_JS and add a code so that in case of 404 it does not send request back to mautic instance.

---

<div class="post-metadata">

**Author:** ![iamjrock](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamjrock/32/7127_2.png) [@iamjrock](https://forum.mautic.org/u/iamjrock)\
**Post date:** [August 5, 2022, 5:24am UTC](https://forum.mautic.org/t/disable-automatic-tracking-from-a-landing-page-set-as-the-mautic-404-page/23143/5 "2022-08-05T05:24:23Z")

</div>

Yeah that would prob work. I was hoping for a pre-existing mautic config or UI solution though.
