# Page Visit Tracking Not Working

**URL:** <https://forum.mautic.org/t/page-visit-tracking-not-working/25698>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [October 16, 2022, 4:34am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698 "2022-10-16T04:34:40Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [October 22, 2022, 8:07am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/22 "2022-10-22T08:07:43Z")

</div>

I double checked this, it supposedly does work with PHP8. I’ve been having issues with Thrive plugins on my websites on this server as well (self-hosted), and I reached out to their plugin support.

I think it’s more of an issue with CyberPanel, so I’m going to be reaching out to them and seeing what the deal is.

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [October 24, 2022, 1:56pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/23 "2022-10-24T13:56:08Z")

</div>

Finally got this working!

Went down the rabbit hole of asking on CloudFlare forums, here, and CyberPanel forums.

Turns out using PHP 7.4 fixed the issue.

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [November 20, 2022, 7:50pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/24 "2022-11-20T19:50:44Z")

</div>

**UPDATE:** And now for some reason it stopped working again. No changes have been made in Mautic. I’ve updated WordPress and my plugins over time, but that’s it.

I noticed it because a lot of leads were added, but they didn’t get segmented properly. At first I thought to myself that “they must have not completed the survey.” Then I tried myself in Incognito and sure enough, it didn’t add me even after the page visit. This is super frustrating. Obviously my setup inside Mautic is correct, since it worked before.

I’m not sure if this has anything to do with it but it says that some of my segments haven’t been updated rebuilt for 278 hours:

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

---

<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:** [November 20, 2022, 9:44pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/25 "2022-11-20T21:44:57Z")

</div>

Check that your cron for segment update is working (php bin/console mautic:segments:update)

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [November 21, 2022, 2:24am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/26 "2022-11-21T02:24:55Z")

</div>

You were spot on! Turns out something is wrong with Cron. This is the output I got when running the command:

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

I don’t know what messed it up or how to solve this. Any idea on what is going on?

---

<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:** [November 21, 2022, 5:05am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/27 "2022-11-21T05:05:13Z")

</div>

Looks like your database credentials might be invalid. Ensure that database credentials in app/config/local.php are valid.

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [November 21, 2022, 6:52am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/28 "2022-11-21T06:52:16Z")

</div>

Thanks for the reply.

I just opened the file in Nano, it’s the same as it is in my control panel thingie. I even tried to change the password to what’s in the Mautic file since that’s the one thing I didn’t know to find otherwise, it said it can’t be the same password so everything is correct with the database credentials.

I did read online to try clearing Mautic cache when I did, it’s still not working.

I wonder how it just stopped working. I’m worried that even if we fix it, this will happen again in the future. Hopefully once we know what it is, we can prevent that. It’s just so weird that no changes were made and it just stopped working out of nowhere.

---

<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:** [November 21, 2022, 12:45pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/29 "2022-11-21T12:45:16Z")

</div>

If you try to login to mysql server with credentials to in app/config/local.php does it work?

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [November 21, 2022, 1:22pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/30 "2022-11-21T13:22:45Z")

</div>

Yes it does, I’m able to log in with PHPMyAdmin with no issues.

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

---

<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:** [November 21, 2022, 4:34pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/31 "2022-11-21T16:34:33Z")

</div>

On the second look, it mght be that you do not have correct php mysql driver installed. Please make sure correct version of php-mysql extension is installed.

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [November 21, 2022, 6:05pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/32 "2022-11-21T18:05:25Z")

</div>

UPDATE: I did a bit of Googling. I just tried to do apt-get install php-mysql on my web server. That seems to have fixed that issue. I can now run the cron mautic:segments:update command successfully.

However, the page visit is still not segmenting. Mautic can see anonymous users that have visited the page, but it isn’t moving the segment of a contact.

I tried manually running the cron commands after I did the survey, but it still didn’t add them.

I’m still super confused as to how it worked and one didn’t. It had to have had that MySQL installed before, right? How did it just uninstall itself? This makes no sense to me, but my Linux and knowledge in this area is very limited.

**UPDATE2: It seems like the campaign actions are pending.**

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

I did some research, Mautic is actually popping up some errors in the log.

[2022-11-21 18:41:02] mautic.WARNING: Command `mautic:campaigns:rebuild` exited with status code 1 {“hostname”:“webserver”,“pid”:5457}  
[2022-11-21 18:41:02] mautic.NOTICE: TypeError: flock(): Argument #1 ($stream) must be of type resource, bool given (uncaught exception) at /home/luminouscityrp.com/public\_html/app/bundles/CoreBundle/Command/ModeratedCommand.php line 143 while running console command `mautic:segments:update` {“hostname”:“webserver”,“pid”:5455}  
[2022-11-21 18:41:02] mautic.WARNING: Command `mautic:segments:update` exited with status code 1 {“hostname”:“webserver”,“pid”:5455}

---

<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:** [November 21, 2022, 8:23pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/33 "2022-11-21T20:23:43Z")

</div>

Maybe it got uninstall during an update (I really cannot tell)?

About the rebuild error. Have you tried clearing the cache with rm -rf var/cache/dev/\* var/cache/prod/\*

and resetting permissions on files and folders and execute the script as that user

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [November 22, 2022, 4:23am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/34 "2022-11-22T04:23:29Z")

</div>

I see, that makes sense. In ProxMox it’s said at the bottom it’s done some “package updates.” My linux knowledge is very limited but that may very well have been what messed it up.

I ran the clear cache command did a permissions fix inside CyberPanel, I’m not sure if that’s the right way to do it or not. This is what I hit:

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

it’s still not tracking the page visits. Is there a fix permissions command to run inside the O.S. itself?

I appreciate all the help, thanks!

---

<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:** [November 22, 2022, 11:22am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/35 "2022-11-22T11:22:22Z")

</div>

Since your server is managed by provider I think it executes shell commands when you click fix permissions.

Not sure what is the reason for failing script. When you execute the script from the terminal, does it show anytinhg else other then the error from the log?

What is shown if you try to run the scripts with -v flag?

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [November 22, 2022, 7:25pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/36 "2022-11-22T19:25:18Z")

</div>

After doing the apt-get to re-install PHP the cron commands work, even with -v:

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

Page tracking is still not working.

The server has stopped with the error in the logs once I removed the cronjob from “crontab -e” in the O.S. and left only the cron jobs in CyberPanel.

But page tracking is still not working.

---

<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:** [November 23, 2022, 1:32am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/37 "2022-11-23T01:32:45Z")

</div>

Glad to see that you got the crons working.

Now as for the page tracking… because I am not quite sure at this point, what do you mean by page tracking.

Can you please explain in a bit more detail where do you see page tracking not working and maybe attach a screenshot?

---

<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:** [November 23, 2022, 6:19am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/38 "2022-11-23T06:19:37Z")

</div>

Maybe you mean, that page visit based campaign actions are not working?

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [November 23, 2022, 11:23am UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/39 "2022-11-23T11:23:19Z")

</div>

Yes, it is not working but it worked before. No changes were made and all of a sudden it stopped working. I’ve tried re-creating it a few times to see if I can get it to work.

Here’s what it looks like:

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

It worked at one point as seen by the statistics:

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

Here is the setup in detail:

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

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

When a subscriber opts-in on my website, they are directed to a survey asking what their knowledge level is. This is so I can talk to newbies differently opposed to intermediate SEOs.

Then they land on different thank you pages. Once they land on those it is supposed to change their segment so they get added to the relevant campaign.

It’s not changing their segments.

---

<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:** [November 23, 2022, 7:42pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/40 "2022-11-23T19:42:19Z")

</div>

Hi, couple of things:

can you please…

1. paste your cron config
2. research links: \< [Troubleshooting Campaigns | Mautic](https://docs.mautic.org/en/campaigns/troubleshooting-campaigns) \> and \< [Campaign does not trigger a page hit after successfully sending an email - #4 by robm](https://forum.mautic.org/t/campaign-does-not-trigger-a-page-hit-after-successfully-sending-an-email/20131/4) \> to see if they are of any help
3. Create another campaign with just one page hit and see if it works.

---

<div class="post-metadata">

**Author:** ![seoninja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seoninja/32/6861_2.png) [@seoninja](https://forum.mautic.org/u/seoninja)\
**Post date:** [November 24, 2022, 12:21pm UTC](https://forum.mautic.org/t/page-visit-tracking-not-working/25698/41 "2022-11-24T12:21:32Z")

</div>

Here is the cron config:

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

I stumbled across that post when I was first Googling before I posted my question. I’ve tried the URL with the wildcard and other ways:

- _thank-you-marketer-level-1_
- [Thank You - Local Rank Ninja](https://www.localrankninja.com/thank-you-marketer-level-1/)
- [Thank You - Local Rank Ninja](http://localrankninja.com/thank-you-marketer-level-1)

None of these methods are working.

Interestingly enough, Mautic _can_ in fact tell that those pages were visited with anonymous users:

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

Yet it somehow doesn’t register that the contact did this so it doesn’t update them.

From what I can understand page tracking is working.

I tried doing it via segmenting filters and I also tried creating a new campaign. These things didn’t work.

[Previous page](https://forum.mautic.org/t/page-visit-tracking-not-working/25698.md?page=1)

[Next page](https://forum.mautic.org/t/page-visit-tracking-not-working/25698.md?page=3)
