# Segment Update By Page Hit Problem In Mautic Detected

**URL:** <https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396>\
**Category:** Product Support\
**Created:** [March 17, 2020, 12:35pm UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396 "2020-03-17T12:35:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamisearojob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamisearojob/32/2197_2.png) [@iamisearojob](https://forum.mautic.org/u/iamisearojob)\
**Post date:** [March 17, 2020, 12:35pm UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/1 "2020-03-17T12:35:07Z")

</div>

**Your software**  
My Mautic version is: v2.16.0  
My PHP version is: 7.3.15

**Your problem**  
**My problem is:**  
Mautic does not update segments on page hit  
I got this problem for so long and it’s not working still  
If I click the link second-time segment updates but users can’t be clicking link twice in real life for their campaign and segment to be updated.

These errors are showing in the log:  
[[2020-03-17 11:20:06] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO mauf1\_campaign\_lead\_event\_failed\_log( `log_id`, `date_added`, `reason`) SELECT id, :dateAdded as date\_added, :message as reason from mauf1\_campaign\_lead\_event\_log WHERE is\_scheduled = 1 AND lead\_id = :contactId AND campaign\_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':dateAdded as date\_added, :message as reason from mauf1\_campaign\_lead\_event\_log ’ at line 2

**strong text**  
Steps I have tried to fix the problem:  
I created my campaign and choose appropriate segment it didn’t work until click link more than 1 for segment to update

---

<div class="post-metadata">

**Author:** ![mayanktiwaridotcom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mayanktiwaridotcom/32/1501_2.png) [@mayanktiwaridotcom](https://forum.mautic.org/u/mayanktiwaridotcom)\
**Post date:** [March 17, 2020, 1:50pm UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/2 "2020-03-17T13:50:41Z")

</div>

Hey,  
Questions:

1. Did you update mautic or fresh install ?
2. Did you try clearing cache ?
3. Can you run `php app/console doctrine:schema:update --dump-sql` to see if there any db update required.

---

<div class="post-metadata">

**Author:** ![iamisearojob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamisearojob/32/2197_2.png) [@iamisearojob](https://forum.mautic.org/u/iamisearojob)\
**Post date:** [March 17, 2020, 7:50pm UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/3 "2020-03-17T19:50:32Z")

</div>

It happened after 4 days of first installation  
i once has issue with the installation said database error site not available no i cleared the installation and started all over again.  
I have build many campaigns in this one  
When i started testing only the first campaigns worked to move users to lead and pending confirmation others didn’t work and my campaign heavily depend on segments.  
Am not too technicall but i will run the cron job you specified and post the result.

Currently i have an installation working just fine on 2.15

---

<div class="post-metadata">

**Author:** ![mayanktiwaridotcom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mayanktiwaridotcom/32/1501_2.png) [@mayanktiwaridotcom](https://forum.mautic.org/u/mayanktiwaridotcom)\
**Post date:** [March 17, 2020, 8:43pm UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/4 "2020-03-17T20:43:55Z")

</div>

Okay, please try the doctrine command i stated in previous one, also let me know mysql version as well.

---

<div class="post-metadata">

**Author:** ![iamisearojob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamisearojob/32/2197_2.png) [@iamisearojob](https://forum.mautic.org/u/iamisearojob)\
**Post date:** [March 18, 2020, 5:51am UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/5 "2020-03-18T05:51:43Z")

</div>

> [@mayanktiwaridotcom](#):
>
> app/console doctrine:schema:update --dump-sql

Thanks my hosting provider was down yesterday so i could try the suggestion  
but i added the cron job now what next do i do as in how do i go about it now

---

<div class="post-metadata">

**Author:** ![mayanktiwaridotcom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mayanktiwaridotcom/32/1501_2.png) [@mayanktiwaridotcom](https://forum.mautic.org/u/mayanktiwaridotcom)\
**Post date:** [March 18, 2020, 8:21am UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/6 "2020-03-18T08:21:24Z")

</div>

ahh you didn’t have to add cron job but run this command directly in order to check if there was any unimplemented changes for database. if you implemented cron job can you please check if there are some logs related to this cron which could prpvide some insight ?

---

<div class="post-metadata">

**Author:** ![iamisearojob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamisearojob/32/2197_2.png) [@iamisearojob](https://forum.mautic.org/u/iamisearojob)\
**Post date:** [March 19, 2020, 4:00pm UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/7 "2020-03-19T16:00:42Z")

</div>

i use cpanel i dont know how to run this command  
i installed mautic on new host same problem  
contact not going to next segment except the visit page twice by clicking link in email  
Please how do i fix it wasted much time on it already.  
Aslso There was even a campaign now working cant i track page visit directly without a user clicking link in email as long as that contact has been previously  
identified through a contact form?

---

<div class="post-metadata">

**Author:** ![iamisearojob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamisearojob/32/2197_2.png) [@iamisearojob](https://forum.mautic.org/u/iamisearojob)\
**Post date:** [March 20, 2020, 10:43am UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/9 "2020-03-20T10:43:06Z")

</div>

Tell me how you plan to install shared hosting or VPS?

Do you have cpanel Femsphil ? You would if you have a shared or dedicated hosting  
You won’t have a Cpanel if you are using any VPS less than $25

Now let’s say you have Cpanel  
Just go over to your Cpanel and login  
Then search for Softaculous  
Search for Mautic  
it will guide with installation very simple  
and you need to take note is user name and password to login directly without c panel always.

Tell me how you plan to install shared hosting or vps? but recommend shared if you are just starting out

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [March 27, 2020, 3:45pm UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/12 "2020-03-27T15:45:25Z")

</div>

A post was split to a new topic: [Mautic setup tutorial video?](https://forum.mautic.org/t/mautic-setup-tutorial-video/13649)

---

<div class="post-metadata">

**Author:** ![mayanktiwaridotcom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mayanktiwaridotcom/32/1501_2.png) [@mayanktiwaridotcom](https://forum.mautic.org/u/mayanktiwaridotcom)\
**Post date:** [March 31, 2020, 7:10pm UTC](https://forum.mautic.org/t/segment-update-by-page-hit-problem-in-mautic-detected/13396/14 "2020-03-31T19:10:17Z")

</div>

I tried installing on my godaddy shared hosting, it was pretty simple though, i was able to use one click install. and then add cron using cron update section, like you said you did.  
for the cache I could delete directory using file manager.  
for running command I had to contact support becuase they don’t allow ssh access directly, but I think your way should have worked too. in that case you should have run:

`php app/console doctrine:schema:update --dump-sql --force`

this command(mind that you will need to specify full path, instead of just app/console).
