Page tracking isn't working/merging for contacts after they log in WooCommerce/WordPress account

Your software
My Mautic version is: 4.4.7
My PHP version is: 8.0.26
My Database type and version is: MySQL 10.6.11-MariaDB-cll-lve

My problem is: When an anonymous lead (id = 200976) access my page, the page tracking work and add points for this lead, as shown by the MySQL ‘leads’ table from Mautic DB in Figure 01. Figure 02 is shown the mts.js/event response and cookies tabs where it is possible to check that the request gets a success (success: 1), was sent data for id=200976, and in the Request Cookies section was sent mtc_id = 200976. So far so good.

Figure 01 - Mautic DB showing that anonymous user (id=200976) get 5 points.

Figure 02 - The Response and Cookies tabs from API call.

But, if a user log-in your WordPress/WooCommerce account (this user already is registered as Mautic contact and has id=200965) and hits/visits another trackable page, the points added don’t merge with the contact’s points and are still being added for the anonymous visitor, as shown in Figure 03. However, as shown in Figure 04, the client sents mtc_id = 200965 in Cookies which corresponds to the right user, and was expected that points to be added to the logged user but this don’t happen and is still being added for anonymous lead.

Figure 03 - Mautic DB showing that points aren’t added for the user with id=200965.

Figure 04 - The Response and Cookies tabs from API call for logged user.

My Mautic runs on a subdomain of my website.

These errors are showing in the log: There is no error log because the API request was successful.

Steps I have tried to fix the problem: I’ve tried to use the WP Fusion and the WP Mautic plugins to insert the page tracker script in my site and have the same results. I’ve tried to call the mt() with the “email” and “firstname” fields but nothing has changed.

Please, can someone help me with this issue? I’ve tried to solve this but I’ve failed so far.

Hi, a quick question: did you set the email address as publicly updateable in custom fields?

1 Like

That’s it! This solves almost the whole problem! Thanks a lot.

I enabled this option on the email custom field (Figure 05 shows the old status) and then the points started to be added to the right lead, as shown in Figure 06, and keep working if logged lead accessed other trackable pages, as shown in Figure 07.

Figure 05 - The old email publicly updatable status.
image

Figure 06 - Points are added for the logged lead just after he logs in and navigates to one trackable page.
image

Figure 07 - Tracking still working for logged lead.
image

I don’t know why this work, to be honest. Because Mautic documentation states this is necessary just for the track using images pixel I guess, and in this case, we are using the JS script to track…

But we still have a little issue here: the points already added for the anonymous user don’t merge with (or transfer to) the registered lead when he logs in. There is a way to solve this?

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.