# Mautic DoubleOptin DOI - Setup of Form-\>Emailaction-\> TRACKINGURL-\>Working BUT not with different IP

**URL:** <https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041>\
**Category:** Product Support\
**Created:** [May 16, 2023, 12:03pm UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041 "2023-05-16T12:03:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcschh](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@marcschh](https://forum.mautic.org/u/marcschh)\
**Post date:** [May 16, 2023, 12:03pm UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/1 "2023-05-16T12:03:42Z")

</div>

**Your software**  
My Mautic version is: 4.4.8  
My PHP version is: 7.4  
My Database type and version is: mariadb 10.5

**Your problem**  
My problem is:  
Mautic DoubleOptin DOI - Setup of Form-\>Emailaction-\> TRACKINGURL-\>SET TAG-\> ISWorking BUT not with different IP

These errors are showing in the log: No Errors in LOG

Steps I have tried to fix the problem: If the user switches from WIFI to Mobile or just use another Emailclient in different location I can see the contact Clicked the link. This is beeing recognized. BUT the TAG is NOT set. I do not understand this.  
Any idea?  
If I switch back to the same IP it is working.  
I made sure that I tried a different browser/incognito + not logged in as admin.

PS: I am new to mautic and I already googled and searched a lot. But I could not find a solution for this.

---

<div class="post-metadata">

**Author:** ![marcschh](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@marcschh](https://forum.mautic.org/u/marcschh)\
**Post date:** [May 16, 2023, 1:24pm UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/2 "2023-05-16T13:24:26Z")

</div>

in details I can see that the REFERER and the SOURCE differs in both cases. But I do not understand the reason.  
it is working if the source is Q: /mtc/event  
How to fix this?

 ![mautic-referer-anon](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/4724e81aa61fb481b9524a52129c94a1a2d07343.png)

From same device/IP (and the tag was successful set:):  
Zeit verbracht auf der Seite: Unbekannt  
Referrer: ###.de/  
Seiten-URL: ###.de/acpt-newsletter/?q=%2Fr%2Fdce215236a6f835bea35222c6  
Device Name: smartphone  
Device Betriebssystem: Android  
Q: /mtc/event  
Page Language: de-DE  
Preferred Locale:de\_DE  
Counter:0  
Timezone Offset:-120  
Resolution:396x880  
[[mehr]](javascript:void(0)😉

Mozilla/5.0 (Android 11; Mobile; rv:109.0) Gecko/112.0 Firefox/112.0

From other device/IP (and the tag was NOT successful set:):  
Zeit verbracht auf der Seite:Unbekannt  
Referrer:Unbekannt  
Seiten-URL: ###.de/acpt-newsletter  
Device Name: desktop  
Device Betriebssystem: GNU/Linux  
Quelle: [OPTINTAGMailNewsletter](https://mautic.###.de/s/emails/view/6)  
Q: /r/dce215236a6f835bea35222c6

Mozilla/5.0 (X11; Linux x86\_64; rv:109.0) Gecko/20100101 Firefox/111.0

---

<div class="post-metadata">

**Author:** ![IonutOjicaDe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ionutojicade/32/7383_2.png) [@IonutOjicaDe](https://forum.mautic.org/u/IonutOjicaDe)\
**Post date:** [May 16, 2023, 10:01pm UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/3 "2023-05-16T22:01:08Z")

</div>

For the DOI, do you have a Campaign?  
So: you have a form, then the contact starts the campaign and you send an email with a link.  
The execution of the campaign should work independently of the IP of the contact, as Mautic adds the tracking code to the link and the click will be recognized. This does not work “zuverlässig” by you?  
Can you add a screenshot of your campaign?

On the other hand: if the same contact visits any of your pages from another IP, as I know, Mautic will add his visits to an “unknown” contact and won’t link his visits to the known contact. I suppose this is not your question, right?

---

<div class="post-metadata">

**Author:** ![marcschh](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@marcschh](https://forum.mautic.org/u/marcschh)\
**Post date:** [May 17, 2023, 4:34am UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/4 "2023-05-17T04:34:23Z")

</div>

I disabled the Campaign-Form and the process is a standard for mwith email-action as I was not happy with the campaign-process. slow and also not every signing/agree was succesful moved from pending to active segments. so I would prefer this.

technically I do not understand what is the problem with the unique link/url … if it is hit the Tags should be added. because in the contact I can see that the link was hit.

---

<div class="post-metadata">

**Author:** ![marcschh](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@marcschh](https://forum.mautic.org/u/marcschh)\
**Post date:** [May 17, 2023, 7:55am UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/5 "2023-05-17T07:55:50Z")

</div>

So if the users opens the Tracking-URL from another IP mautic recognizes the site-access(tracking-url) in the correct contact. BUT the mtc.js? is Tagging a new IP-contact - from my point of view this is not correct - so it is a bug or do I have to correct my configuration?

Tracking via URL is enabled.  
IP anonomize is enabled (due to law)

---

<div class="post-metadata">

**Author:** ![marcschh](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@marcschh](https://forum.mautic.org/u/marcschh)\
**Post date:** [May 17, 2023, 8:11am UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/6 "2023-05-17T08:11:50Z")

</div>

found these issues in the bugtracker. both confirmed and closed due to stale but not solved

> <https://github.com/mautic/mautic/issues/11527>
>
> \### Mautic Version
> 
> 4.4.x series
> 
> \### PHP version
> 
> 7.4
> 
> \### What browsers are yo…u seeing the problem on?
> 
> Chrome
> 
> \### What happened?
> 
> When a contact is identified using mtc.js, the cookies for the identified user is updated so future traffic is associated with the contact. However, the original anonymous contact is not merged into the now pre-existing identified user.
> 
> \### How can we reproduce this issue?
> 
> Step 1: Select a contact from Mautic. For this example, we will use user ID 1 with email someone@example.com
> Step 2: Open a private browsing window. Navigate to website where the tracking code is installed. Your user ID is now 2.
> Step 3: Send the following mtc.js event: mt('send', 'pageview', {email: 'someone@example.com'}); This is identifying user ID 2 as being the same as user ID 1.
> Step 4: Confirm that the Mautic tracking cookies updated. The tracking cookie has been updated from the user ID being 2 to the user ID being 1. Future traffic will be logged to user ID 1, however the existing traffic for user ID 2 is not merged into user ID 1.
> 
> \### Relevant log output
> 
> \_No response\_
> 
> \### Code of Conduct
> 
> \- \[X\] I confirm that I have read and agree to follow this project's Code of Conduct

> <https://github.com/mautic/mautic/issues/11612>
>
> \### Mautic Version
> 
> 4.4.x series
> 
> \### PHP version
> 
> 7.4.32 & 8.0.24
> 
> \### What bro…wsers are you seeing the problem on?
> 
> Firefox, Chrome
> 
> \### What happened?
> 
> I have prepared a case in which I would like to provide the user with an URL to a WordPress page with UTM tags in which I put a Mautic form.
> 
> That form is configured, as proposed in https://docs.mautic.org/en/components/forms/utm-tags-form, to record UTM tags.
> The purpose of the case is to know the campaign, medium and source where the user came from when she filled the form.
> 
> When run, this case records two contacts (one anonymous and one identified by the data filled in the form). Mautic records UTM data for the anonymous user but does not replicate that information to the contact identified.
> 
> !\[mautic\_error\_form\_utm\_01\](https://user-images.githubusercontent.com/126643/196656910-19847c4f-92aa-45c4-ae7a-09551cf33ba1.png)
> !\[mautic\_error\_form\_utm\_02\](https://user-images.githubusercontent.com/126643/196656927-521eaa7e-9aa2-492b-a81e-65ba7b41dc3b.png)
> !\[mautic\_error\_form\_utm\_03\](https://user-images.githubusercontent.com/126643/196656942-000469a0-db22-4f32-a41d-b3089bb1e5d7.png)
> 
> 
> \### How can we reproduce this issue?
> 
> \* I started with a completly empty and fresh installation of Mautic and the WordPress site has also the javascript tracking code provided by Mautic configured in its head section.
> 
> \* Both sites run in the same domain:
> - WordPress: https://mydomain.com
> - Mautic: https://marketing.mydomain.com
> 
> \* WordPress page include the form via the javascrit provided for that form:
> \<script type="text/javascript" src="//marketing.mydomain.com/form/generate.js?id=1"\>\</script\>
> 
> \* WordPress site include the Mautic's tracking code in its head section.
> 
> \* The URL to test is: https://mydomain.com/testing-utm-form-mautic?utm\_campaign=test01\_campaign&utm\_medium=test01\_medium&utm\_source=test01\_source
> 
> When I run the case I see that Mautic creates two contacts:
> \- One anonymous (recognized by the IP where I run this case) in which the UTM are captured correctly.
> \- A second one with the data (first name, last name and email address) filled in the form.
> 
> If I see the timeline for that second user in Mautic I can see that there is a record where it says that UTM tags were recorded but when I open the details of that event nothing but the form ID is shown.
> 
> Thinking that it could be an error of visualization in the front end I opened up the database to see what was really happening. I could find that there were two records in the "leads" table (as mentioned before) and two records in the "leads\_utmtags" table. The UTM data for the anonymous contact are correctly filled in this table but the UTM data regarding the other lead (the identified one) has NULL in all of her UTMs columns.
> 
> \### Relevant log output
> 
> \_No response\_
> 
> \### Code of Conduct
> 
> \- \[X\] I confirm that I have read and agree to follow this project's Code of Conduct

☹

---

<div class="post-metadata">

**Author:** ![IonutOjicaDe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ionutojicade/32/7383_2.png) [@IonutOjicaDe](https://forum.mautic.org/u/IonutOjicaDe)\
**Post date:** [May 18, 2023, 5:39am UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/7 "2023-05-18T05:39:29Z")

</div>

I would never rely on the browser cookie to identify a contact.  
On the same device (also browser) can be more than one person active.

The bullet proof method is by using a tracking link inside the email.

> IP anonomize is enabled (due to law)

Are you from Germany? I am not aware that this is not allowed. I thought that the linking of tracking information to persons is not allowed without their consent. For the “unknown visits”, there is no linking to any person. A person cannot be identified by an IP, or it is not easy, I am not aware how could someone do it.

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [May 19, 2023, 7:24am UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/8 "2023-05-19T07:24:01Z")

</div>

IP anonymize should be enabled - same as for other services. Full IP is considered to be personally identifiable data (because with help of a jury and the telco you can link it back to a person (owner of the Internet access) using it at the given time).

@marcschh I still think this is some kind of missunderstanding / missconfiguration: The tracking of a confirmation via a unique link and letting a campaign watch out for this “landing page visit” works pretty reliable. Its not at all depending on mtc.js - its always the click on the loaded link.

---

<div class="post-metadata">

**Author:** ![marcschh](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@marcschh](https://forum.mautic.org/u/marcschh)\
**Post date:** [May 19, 2023, 11:09am UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/9 "2023-05-19T11:09:29Z")

</div>

I have the feeling that we are getting away from the real problem.

I have a wordpress site which is using WP-Mautic to load the Mautic form  
[mautic type=“form” id=“x”]

the Mautic-Form creates a contact with the mail-address

the user follows the link inside the email which is the mautic-tracking-url redirecting to another wordpress-site which should add the Tag to the contact who clicked the tracking-url  
`[mautic type="tags" values="DoubleOptIn"]`

This is working great if the user has the same device/ip as you can see in the screenshot here (I am not talking about COOKIES as it works fine without in two private-browser-sessions):

 ![Contact-Successful-Tagged](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/d6c232267fb1242f5c3d0434f0876753a58e66d9.png)

If the user who filled the form is clicking the email from another device/ip it is not working. EVEN if mautic recognizes that the correct contact followed the tracking-url it is not adding the Tags. The Tags are added to a new anonymous contact (new IP)

 ![Contact-Successful-NOTTagged](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/56e145bc462a956944773841d8d767040ee9f07a.png)

 ![Contact-Successful-Tagged-New-Anon](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/79632a6b9d11b77bafcf62a66245f7a480fce3c8.png)

This is the problem I am talking about…

---

<div class="post-metadata">

**Author:** ![marcschh](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@marcschh](https://forum.mautic.org/u/marcschh)\
**Post date:** [May 19, 2023, 11:15am UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/10 "2023-05-19T11:15:39Z")

</div>

and some more confusing info is  
As you can the on the screenshot the “successful” contact has to TAGs. (MauticOptIn AND DoubleOptIn)  
The SAME landingpage has two variants setting the TAG  
`img src="https://OPTINLANDINGPAGE-on-wordpress.de/mtracking.gif?tags=MauticOptIn" alt="Mautic Tags"`

AND the WP-MAUTIC Code  
`[mautic type="tags" values="DoubleOptIn"]`

So the WP-MAUTIC Code is not working AT ALL if the user switches the device/IP  
But the tracking.gif is working

---

<div class="post-metadata">

**Author:** ![marcschh](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@marcschh](https://forum.mautic.org/u/marcschh)\
**Post date:** [May 19, 2023, 11:20am UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/11 "2023-05-19T11:20:05Z")

</div>

If I click on the UNSUBSCRIBE Link in the same email from the SAME Device with the different IP Mautic recognize it for the correct contact-with the Email-Contact.  
So I am searching for a solution getting The Tags working. Hope you can help me finding out the issue

thank you

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [May 19, 2023, 1:11pm UTC](https://forum.mautic.org/t/mautic-doubleoptin-doi-setup-of-form-emailaction-trackingurl-working-but-not-with-different-ip/28041/12 "2023-05-19T13:11:58Z")

</div>

Hi, a bit of a uncommon setup of “opt-in” process…

“the user follows the link inside the email” … so instead of having a campaign, that whatches it the user clicked that link (aka “visits landingpage”) which works 100%, you bet on tagging a contact via mtracking.gif. Which may be filtered out due to browser settings (think third party script) as the URL called differs from the site its embedded into? The mtracking.gif relies on the cookie information. If the cookie doesn’t get set correctly in the virgin browser, I bet there is now some anonymous tagged user in your database.

The unsubscribe link doesn’t care about the the browser and IP - it just tracks the link opened from the mail.

The same way you should setup your optin process. Not based on some tagging of a user, but by watching the “landing page” visit of the user you sent the mail to. That works reliable always. Make sure, the contact is already in the campaign, that watches for it. Send the optin mail from the campaign, otherwise the user may have clicked already before your campaign started watching.
