Skip to content

Conversation

kuzmany
Copy link
Member

@kuzmany kuzmany commented May 4, 2025

Remove Identify visitor by tracking url configuration settings usage

Q A
Bug fix? (use the a.b branch) ✔️❌
New feature/enhancement? (use the a.x branch) ✔️❌
Deprecations? ✔️❌
BC breaks? (use the c.x branch) ✔️❌
Automated tests included? ✔️❌
Related user documentation PR URL mautic/user-documentation#...
Related developer documentation PR URL mautic/developer-documentation-new#...
Issue(s) addressed Fixes #...

Description


📋 Steps to test this PR:

Seems like we do not need this option in configuration. From some refactoring, contacts are identified by CT parameter by default with the line: https://github.com/mautic/mautic/pull/14974/files#diff-ff1cf0e25a20c2ebe5f252374318df2cb7aa36bb6c880db1a693f3e2e2e4ec8cL122

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Just check if tracking works like before

@kuzmany kuzmany changed the title The track_by_tracking_url configuration setting has been removed The Identify visitor by tracking url configuration setting has been removed May 4, 2025
@kuzmany kuzmany changed the title The Identify visitor by tracking url configuration setting has been removed Remove Identify visitor by tracking url configuration setting May 4, 2025
Copy link

codecov bot commented May 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.47%. Comparing base (ce44e19) to head (fa59bf0).
Report is 116 commits behind head on 7.x.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                7.x   #14974      +/-   ##
============================================
- Coverage     66.49%   66.47%   -0.02%     
+ Complexity    35186    35178       -8     
============================================
  Files          2317     2317              
  Lines        141875   141855      -20     
============================================
- Hits          94335    94305      -30     
- Misses        47540    47550      +10     
Files with missing lines Coverage Δ
...bundles/LeadBundle/Helper/ContactRequestHelper.php 83.51% <ø> (-7.58%) ⬇️
...dles/PageBundle/EventListener/ConfigSubscriber.php 100.00% <ø> (ø)
...es/PageBundle/Form/Type/ConfigTrackingPageType.php 100.00% <ø> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kuzmany kuzmany marked this pull request as ready for review May 4, 2025 21:40
Copy link
Contributor

@andersonjeccel andersonjeccel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, the feature places the contact email address as part of the URL to help the tracking script understand who is that contact to then create a cookie
This seemed particularly useful for cases when GDPR or business privacy choices are limited by anonymized IP and the website has cookie modules for blocking everything before users can or not set their consent, or when you need to identify the contact within a CMS based on the email contained on the URL

I feel the removal might break some of the use cases, what do you think?

@andersonjeccel andersonjeccel added the pending-feedback PR's and issues that are awaiting feedback from the author label May 7, 2025
@kuzmany
Copy link
Member Author

kuzmany commented May 7, 2025

@andersonjeccel I'm not sure what you're referring to. Just a few lines above (https://github.com/mautic/mautic/pull/14974/files#diff-ff1cf0e25a20c2ebe5f252374318df2cb7aa36bb6c880db1a693f3e2e2e4ec8cR120) does the same thing. Identify contact from tracking URL by default.

@andersonjeccel
Copy link
Contributor

@kuzmany Most things I ask as end user, just can't understand looking at the code :/

Thank you for replying

@kuzmany kuzmany added ready-to-test PR's that are ready to test and removed pending-feedback PR's and issues that are awaiting feedback from the author labels May 8, 2025
@RCheesley RCheesley added T1 Low difficulty to fix (issue) or test (PR) code-review-needed PR's that require a code review before merging tracking Anything related to tracking labels Jun 17, 2025
@RCheesley RCheesley moved this to 🦸🏻 Needs 2 tests in Open Source Fridays Jun 17, 2025
@kuzmany
Copy link
Member Author

kuzmany commented Jul 10, 2025

@escopecz please

Copy link
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find in the email subscriber where it handles $clickthrough['lead'] like in the removed code. Can you send me a link?

@github-project-automation github-project-automation bot moved this from 🦸🏻 Needs 2 tests to 🚨 Developer revision needed in Open Source Fridays Jul 10, 2025
@kuzmany
Copy link
Member Author

kuzmany commented Jul 10, 2025

@escopecz this method make it (mergeWithTrackedContact)

return $this->mergeWithTrackedContact($contact);

Co-authored-by: John Linhart <admin@escope.cz>
@escopecz
Copy link
Member

@escopecz this method make it (mergeWithTrackedContact)

return $this->mergeWithTrackedContact($contact);

@kuzmany I went through the subscribers and couldn't see the $clickthrough['lead'] handled by them. So I'm afraid we'll lose some tracking identifications if we remove the only code that is handling that.

@kuzmany
Copy link
Member Author

kuzmany commented Jul 10, 2025

public static function getSubscribedEvents(): array
do that

@kuzmany
Copy link
Member Author

kuzmany commented Jul 14, 2025

@escopecz same subscriber as for email redirect links is for sms. These subscribers handle identification.

This way what we remove still need field mark as public updateable, I guess nobody enabled it.

@escopecz
Copy link
Member

@kuzmany I think we don't understand each other. You are removing code that is getting the identification from the clickthrough array based on the $clickthrough['lead'] key. I'm saying that it was the only place where this happened. There is no other place where we are handling the lead key from the clicktrhough. I can't see it in any of the places you've linked.

Does that mean that this clicktrhough key is unused and other keys are used to identify the contact?

@kuzmany
Copy link
Member Author

kuzmany commented Jul 15, 2025

@escopecz I understand what you are trying to say. But this feature is so complicated and not useful. And require manual steps to use it (nobody use it)

Main purpose build it years ago was identify contact from redirect links from emails.

This is now cover in subscriber for email redirect links and for sms as well.
Even If do not use $clickthrough['lead'],but $clickthrough['stat'], result is same.

Identify from email tracking link is already covered. We cannot keep this old, legacy and not useful way to identify contact.

Another way would be improve it without use publicly updateable option.
Also see issue this code pass email address as query param during the process it.

But If you decide, you can close it.
Probably we can rewrite all this feature to avoid using publicly updateable...

@escopecz
Copy link
Member

@kuzmany I'm all for removing stuff that no one uses. My only worry is that we'll break something. I can't spend hours researching each PR that I'm asked to review. Even when I try to timebox every review I still am behind and the queue is getting worse every day. That's why I'm asking dumb questions that I could answer myself with my own research.

Copy link
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you are correct. Using the contact ID isn't optimal and seems like an outdated way to do it. It was replaced with the LeadEvents::ON_CLICKTHROUGH_IDENTIFICATION event and every plugin can hook into that. The EmailBundle is implementing it and finds the contacts based on the email stat hash. That is present since 2018 so I think the email links generated before that are irrelevant these days and it's safe to remove it.

The new implementation is here:

$stat = $this->statRepository->findOneBy(['trackingHash' => $clickthrough['stat']]);

@escopecz escopecz added pending-test-confirmation PR's that require one test before they can be merged bc-break A BC break PR for major release milestones only code-review-passed PRs which have passed code review and removed ready-to-test PR's that are ready to test code-review-needed PR's that require a code review before merging labels Jul 15, 2025
@escopecz escopecz added this to the 7.0.0-alpha milestone Jul 15, 2025
@escopecz escopecz moved this from 🚨 Developer revision needed to ⏳︎ Needs 1 more test in Open Source Fridays Jul 15, 2025
@escopecz escopecz added the refactoring The change does not change behavior but improves the code label Jul 15, 2025
@mautibot
Copy link
Contributor

This pull request has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/public-release-of-mautic-7-0-alpha/36111/2

@escopecz
Copy link
Member

escopecz commented Aug 4, 2025

Let's get this merged into M7-alpha as it's a BC break. Too bad there isn't any second reviewer.

@Bastian2718
Copy link

I do not really know how to test because my understandings of tracking are not that good but with a little help I would test it

Copy link

sonarqubecloud bot commented Aug 4, 2025

@escopecz escopecz merged commit 9645a38 into 7.x Aug 4, 2025
45 of 46 checks passed
@github-project-automation github-project-automation bot moved this from ⏳︎ Needs 1 more test to 🥳 Done in Open Source Fridays Aug 4, 2025
@escopecz escopecz added the enhancement Any improvement to an existing feature or functionality label Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bc-break A BC break PR for major release milestones only code-review-passed PRs which have passed code review enhancement Any improvement to an existing feature or functionality pending-test-confirmation PR's that require one test before they can be merged refactoring The change does not change behavior but improves the code T1 Low difficulty to fix (issue) or test (PR) tracking Anything related to tracking
Projects
Status: 🥳 Done
Development

Successfully merging this pull request may close these issues.

6 participants