# Double-Optin by GET - Parameter

**URL:** <https://forum.mautic.org/t/double-optin-by-get-parameter/7553>\
**Category:** Product Support\
**Created:** [February 16, 2017, 4:07am UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553 "2017-02-16T04:07:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TonX](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@TonX](https://forum.mautic.org/u/TonX)\
**Post date:** [February 16, 2017, 4:07am UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/1 "2017-02-16T04:07:09Z")

</div>

Hi Community!  
  
Since days (!) i’m looking for a solution for my desired double - opt - in method but really can’t find a way to create this.  
  
I want users to enter their E-Mail Adress, send them an E-Mail with an unique Link to a landing page and then add the user to my “Newsletter Confirmed” segment.  
  
  
  
So: Enter E-Mail - Adress in Form -\> Send Mail with Link like [https://mautic.domain.com/confirm-page?mail=usermail@gmail.com](https://mautic.domain.com/confirm-page?mail=usermail@gmail.com) -\> User Clicks Link -\> Segment “Newsletter Confirmed” added, depending on the “mail” - parameter.  
  
  
  
I created the form, the campaign and the landing page. But I really don’t know how to make Mautic add the contact to another segment just by visiting the user - specific URL?  
  
  
  
I already thought about creating a PHP - File and use the Mautic API to achieve this, but maybe there is a more easy version?  
  
  
  
Many thanks in advance!!  
  
David  
  
  
  
EDIT: I found this  
  
[https://www.mautic.org/community/index.php/5471-how-to-setup-double-opt-in-version-2-1-1/0](https://www.mautic.org/community/index.php/5471-how-to-setup-double-opt-in-version-2-1-1/0)  
  
but this is NOT what I want. I want Mautic to change the segment just by visiting the static page, I don’t want to make the user click another “Confirm” button…

---

<div class="post-metadata">

**Author:** ![TonX](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@TonX](https://forum.mautic.org/u/TonX)\
**Post date:** [February 16, 2017, 4:07am UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/2 "2017-02-16T04:07:09Z")

</div>

Hi Community!  
Since days (!) i’m looking for a solution for my desired double - opt - in method but really can’t find a way to create this.  
I want users to enter their E-Mail Adress, send them an E-Mail with an unique Link to a landing page and then add the user to my “Newsletter Confirmed” segment.

So: Enter E-Mail - Adress in Form -\> Send Mail with Link like [https://mautic.domain.com/confirm-page?mail=usermail@gmail.com](https://mautic.domain.com/confirm-page?mail=usermail@gmail.com) -\> User Clicks Link -\> Segment “Newsletter Confirmed” added, depending on the “mail” - parameter.

I created the form, the campaign and the landing page. But I really don’t know how to make Mautic add the contact to another segment just by visiting the user - specific URL?

I already thought about creating a PHP - File and use the Mautic API to achieve this, but maybe there is a more easy version?

Many thanks in advance!!  
David

EDIT: I found this  
[https://www.mautic.org/community/index.php/5471-how-to-setup-double-opt-in-version-2-1-1/0](https://www.mautic.org/community/index.php/5471-how-to-setup-double-opt-in-version-2-1-1/0)  
but this is NOT what I want. I want Mautic to change the segment just by visiting the static page, I don’t want to make the user click another “Confirm” button…

---

<div class="post-metadata">

**Author:** ![TonX](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@TonX](https://forum.mautic.org/u/TonX)\
**Post date:** [February 16, 2017, 1:37pm UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/3 "2017-02-16T13:37:50Z")

</div>

Obviously you did not even read my question. This is NOT what I want. I want to send an email like  
confirmationpage.php?email=username@gmail.com  
and change the contacts segment / tags what so ever using the get parameter as identifier.

---

<div class="post-metadata">

**Author:** ![bchiam](https://avatars.discourse-cdn.com/v4/letter/b/bcef8e/32.png) [@bchiam](https://forum.mautic.org/u/bchiam)\
**Post date:** [February 16, 2017, 1:51pm UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/4 "2017-02-16T13:51:45Z")

</div>

[quote=20161:@TonX]Obviously you did not even read my question. This is NOT what I want. I want to send an email like  
confirmationpage.php?email=username@gmail.com  
and change the contacts segment / tags what so ever using the get parameter as identifier.[/quote]

MxyzptlkFishStix is helping you and you should be appreciative about it. Here is a community we helping each other. We do not owe you an answer.

Now you better use your imagination and find out your own answer.

---

<div class="post-metadata">

**Author:** ![tomaszkryk](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tomaszkryk](https://forum.mautic.org/u/tomaszkryk)\
**Post date:** [October 10, 2017, 10:54am UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/5 "2017-10-10T10:54:10Z")

</div>

[quote=20152:@MxyzptlkFishStix]Form -\> Actions -\> Modify Contact’s Tags -\> Pending  
Two Segments - \> Pending Contacts & Confirmed Contacts.  
Pending Contacts -\> Filter -\> Tags - Including - Pending + Filter -\> Tags - Excluding - Confirmed  
Confirmed Contacts -\> Filter -\> Tags - Including - Confirmed  
Campaign named Confirmed -\> Contact Source -\> Pending Contacts -\> Visits A Page ([https://www.example.com/confirmed](https://www.example.com/confirmed)) -\> Modify Tags -\> Add Confirmed + Remove Pending

There’s about three or four different ways you can do this. Use your imagination. Experiment.[/quote]

Hi,  
first of all thanks for sharing this solution though it’s common topic, so I hope you will find a little bit of time and maybe you will help with my problem.

This solution doesn’t work in one example (as far as I know). I’ve tried to find a better way, but I think that only solution to this problem is creating “confirmation link” (as {webview\_url}). My problem is with this scenerio (which is more common than I assumed):

1. New user visits [mysite.com](http://mysite.com) from computer C1 - mautic gives him ID: IDX, but this user uses multipile devices (for example mobile and desktop or desktop and laptop, or he uses [mysite.com](http://mysite.com) at work, and in home).
2. The same user goes into [mysite.com](http://mysite.com) but from another computer C2, now mautic gives him ID: IDY (this is important step, without it everything goes as planned) and it happens before user will fill out any form on [mysite.com](http://mysite.com).
3. Now user using C1 (for example computer at work) fills out form in [mysite.com](http://mysite.com), so user IDX will get activation email (but it’s not sending immediately, sometimes you need to wait, or just don’t have time to confirm) so he does not confirm it at C1 (at work) but later at home.
4. User goes to home and with computer C2 loggs into email account and he clicks url [mysite.com/confirmed](http://mysite.com/confirmed) - but now only user IDY which is still anonymous and is not in our Pending segment will get confirmed. And we cannot send for example welcome campaign because user is identified on computer C1 as IDX, and on computer C2 as IDY. So first one is still in Pending and not cofnfirmed state, and the other one maybe has Confirmed, but we don’t have email in his profile so we can’t send any message.

I thought that it was minor problem, but my clients report to me that at least 20-30% of contacts don’t receive welcome campaign due to above problem with this solution.

So I think that there is no better way than {confirmation\_url} which is independent from mautic contact ID, because you never now from which computer user will click this activation link.

So what do you think is there any other way which could be better to get confirmation?

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 10, 2017, 1:58pm UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/6 "2017-10-10T13:58:39Z")

</div>

As far as I understood how Mautic works, it is not relevant from which IP address the link is clicked. The link is masked to be unique for the lead and should be tracked.

@tomaszkryk, in your example the user creates two lead records: one that is anonymous and stays anonymous, and one that is anonymous and gets identified when the lead user data is entered into the form.

---

<div class="post-metadata">

**Author:** ![tomaszkryk](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tomaszkryk](https://forum.mautic.org/u/tomaszkryk)\
**Post date:** [October 10, 2017, 3:11pm UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/7 "2017-10-10T15:11:21Z")

</div>

I thought so, but in documentation I read that when there is a cookie (mtc\_id) it has priority. So if anonymous lead was earlier at the website it has mtc\_id cookie and when this lead clicks an email this mtc\_id from cookie will be used. Contact\_Id from an email will be used but only then, when there is no mtc\_id cookie.

I found this here:  
[https://mautic.org/docs/en/contacts/contact\_monitoring.html](https://mautic.org/docs/en/contacts/contact_monitoring.html)

Section:  
Identify vistior by tracking url

Maybe I’m wrong about it. But it is easy for me to duplicate this behavior (when I’am using two different browser) and campaign set as described above, two leads are created and only one has email field populated and the other one has a Page Visit in [mysite.com/confirmed](http://mysite.com/confirmed). But maybe I don’t understand something and there is problem somwhere else in my configuration.

If i find a little bit of time, I will prepare a detailed test for it, maybe then someone will point me a right direction, because now in 20-30% of cases users won’t get coupon code for shopping carts when they sign up to newsletters, and they are calling and asking why (that’s the reason I’m searching what is going on ;-)) - at first I thought that it was spam issue, but they get activation email, they click, and they don’t get welcome email.

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 10, 2017, 3:53pm UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/8 "2017-10-10T15:53:21Z")

</div>

Maybe you are right. I just reproduced this: I used my desktop (with wifi) to register and my phone (with cellular) to DOI and it did not record my page visit. If it is that way, it would not be good.

---

<div class="post-metadata">

**Author:** ![tomaszkryk](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tomaszkryk](https://forum.mautic.org/u/tomaszkryk)\
**Post date:** [October 10, 2017, 5:41pm UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/9 "2017-10-10T17:41:24Z")

</div>

I found a way around this - it’s maybe not elegant one, but it worked.

In activation email I put link like this:  
[mysite.com/confirmed?email={contactfield=email}](http://mysite.com/confirmed?email=%7Bcontactfield=email%7D)

On my welcome page (confirmed page) I put extra js line:  
mt(‘send’,‘pageview’,{email: emailFromUrl});  
from url i get ‘email’ parameter into ‘emailFromUrl’ variable.

it makes second pageview (on my confirmed page there is original mautic js code), but it forces mtc\_id to be correct.

I will test it more in saturday and if it will really works (I’m a little bit tired with this right now ;-)), I will share with exact instruction and .js code.

Have a nice evening!

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 12, 2017, 5:48am UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/10 "2017-10-12T05:48:48Z")

</div>

That looks nice. Please let us know if this solved the problem.

---

<div class="post-metadata">

**Author:** ![robwent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robwent/32/179_2.png) [@robwent](https://forum.mautic.org/u/robwent)\
**Post date:** [October 18, 2017, 1:03am UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/11 "2017-10-18T01:03:25Z")

</div>

the email field needs to be set to be publicly updateable for this to work.

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 18, 2017, 4:58am UTC](https://forum.mautic.org/t/double-optin-by-get-parameter/7553/12 "2017-10-18T04:58:44Z")

</div>

@tomaszkryk, any news on this?
