# Instant opt-in YouTube video by Joey Keller

**URL:** https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948
**Category:** Product Support
**Created:** [December 8, 2021, 11:25pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948 "2021-12-08T23:25:20Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [December 8, 2021, 11:25pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/1 "2021-12-08T23:25:21Z")

</div>

@joeyk I am assuming this is your YouTube over at [Update: Instant Double Opt-in with Mautic (3 Methods) - YouTube](https://www.youtube.com/watch?v=ft3IOI1afow&t=484s).

I set up the way you described in the video and it working for me but I got a question or two.

I noticed that there is a bunch of invisible contacts with ip address on it no names or no email addresses.

It turns out that whenever any devices visit the confirmation page, either a live person, a bot or search engine, it will generate a contact card with just only their ip address.

I had to keep deleting those blank contact cards from the contact database.

Is there a way to prevent this happening?

See attached screenshot -

 ![Screen Shot 2021-12-08 at 5.24.37 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cf1c3a99e8a2ac2f7861ea96d1a585cbf5c7cf0a.jpeg)

---

<div class="post-metadata">

### Author: ![mojo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mojo/32/543_2.png) [@mojo](https://forum.mautic.org/u/mojo)
#### Post date: [December 9, 2021, 8:02am UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/2 "2021-12-09T08:02:27Z")

</div>

These are the contacts assigned to the segment.  
Please show segment and campaign settings

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [December 9, 2021, 3:16pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/3 "2021-12-09T15:16:40Z")

</div>

There is no campaign yet …

I am just setting up an opt in to assign a btg tag to those that sign up for the Bridge the Gap newsletter with a tracking tag on the confirmation page when they click on the link in the confirm email address.

This is the string I use on confirmation page where members opts-in their email address

`<img src="https:// ***********.org/mtracking.gif?email=<? echo $_GET['email'];?>&tags=BTG">`

Here the segment setting I set up to add those contact with the tags into the segment.

 ![Screen Shot 2021-12-09 at 9.01.36 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/a2ac67b11a4b35805d1c7f3318976a1d19a24f8b.jpeg)

But it still adding blank contact with ip address when the confirmation page is hit by someone without a link from email or from a bots.

Here a screenshot log when I go visit the page confirmation page. without a link from email. (my ip address edited out)

 ![log](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/b73994fd798cc3876cf1d5ac5d1a8abf42ff99ac.jpeg)

It seem it will create a new contact just by visiting the page with blank email and name. I could be wrong

It does not appear in the contact list and. remain invisible however it does appear under the segment’s contact counts and contact list.

Only 3 shown in contact list - those are for testing purpose …It not on live production yet that why it only have 3 contacts.

 ![Screen Shot 2021-12-09 at 9.12.22 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/eec4fd72739873a247c7a4bb14ed74cf4ae8e6c0.jpeg)

There are total of 11 contacts in the segment with btg tag … 8 of them have ip address only and it is hidden but it annoying to see it being counted when there is 3 with email and name attached to it while 8 are blank with ip address only.

 ![Screen Shot 2021-12-09 at 9.11.55 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e1bebed6d8fd4d807d5a89b5d04628479bdcc699.jpeg)

I can only guess it being created whenever a bot or someone discovered the page without the confirmation link.

I could be wrong about all this.

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [December 9, 2021, 5:48pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/4 "2021-12-09T17:48:44Z")

</div>

Hi,  
Originally I made 2 videos. The first video explains how to use a double optin procedure. It is relying on clicks in emails rather then visits in landing pages. The second one (the one you referring to) shows how to do without waiting for cronjobs. And yes, it has the disadvatage of passing the tag to any visitor. You can restrict that by only passing valid emails:

```auto
<? if(isset($_GET['email'])) {
echo "<img src='https:// ***********.org/mtracking.gif?email=".$_GET['email']."&tags=BTG' />";
}; ?>

```

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [December 9, 2021, 6:48pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/5 "2021-12-09T18:48:13Z")

</div>

Thank you!

I will try this out. I can see with IF statement that it should prevent it but I will report back either result.

🙂

---

<div class="post-metadata">

### Author: ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)
#### Post date: [December 28, 2021, 6:21pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/6 "2021-12-28T18:21:07Z")

</div>

Hi, Did you use this with GrapesJS?  
i try use this code with GrapesJS

```auto
	<? if(isset($_GET['email'])) {
echo "<img src='https:// ********** /mtracking.gif?email=".$_GET['email']."&tags=Status:%20Active,-Pending%20Email%20Confirmation' />";
	}; ?>

```

when I save the page and reopen it I get:

```auto
  <!--? if(isset($_GET['email'])) {
echo "<img src='https:// **********.com/mtracking.gif?email=".$_GET['email']."&tags=Status:%20Active,-Pending%20Email%20Confirmation' /-->";
  }; ?&gt;

```

and not working (

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [December 28, 2021, 7:06pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/7 "2021-12-28T19:06:18Z")

</div>

Hi,

I did not have time to watch entire video but I think separate php script was created on website he is trying to track/get the info from.

The reason you get the above output after save is because your are copying the php code to editor that does not expect it (grapeJS). Your input is escaped for security reasons.

Also I would advise you use `<?php /*code here*/ ?>` tag to enclose php code since short tags might be disabled by configuration.

Hope it helps somehow.

---

<div class="post-metadata">

### Author: ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)
#### Post date: [December 28, 2021, 7:19pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/8 "2021-12-28T19:19:02Z")

</div>

i try use full tags - also not working (

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [December 28, 2021, 7:42pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/9 "2021-12-28T19:42:09Z")

</div>

The code was for Wordpress or other php app. What are you exactly trying to do?  
Joey

---

<div class="post-metadata">

### Author: ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)
#### Post date: [December 28, 2021, 7:59pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/10 "2021-12-28T19:59:04Z")

</div>

I am making a subscription confirmation page inside mautic using grapesjs and trying to insert your php code there

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [December 28, 2021, 10:22pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/11 "2021-12-28T22:22:02Z")

</div>

Don’t do it. You can’t run php code inside of grapejs. It was an example for third party builders

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [March 7, 2022, 8:38pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/12 "2022-03-07T20:38:07Z")

</div>

@joeyk

Has there been any change to this with compose version Mautic?

I deleted the Mautic and I did a fresh install using compose then add the new tracking number to the page but it no longer tagging new contact on new fresh install of Mautic using compose.

This is what I am using on my “Confirmed web page”

```auto
<? if(isset($_GET['email'])) {
echo "<img src='https://mas.agwm.org/mtracking.gif?email=".$_GET['email']."&tags=BTG' />";
}; ?>

```

It still not tagging new contacts on my new mautic. I watched the video a couple of time and looked at my previous mautic but I can’t find any different between the two installation.

Is there an extra step for compose installed mautic?

Thank you

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [March 8, 2022, 3:38pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/13 "2022-03-08T15:38:00Z")

</div>

Hi,  
Not that I know of.  
I didn’t take a deep dive in it yet, so I can’t have a strong opinion 🙁  
Joey

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [March 8, 2022, 4:14pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/14 "2022-03-08T16:14:43Z")

</div>

It just odd that it stopped working after I change over mautic to compose installation. There are no error message anywhere or in browser console.

Are you using compose installed Mautic with instant opt in?

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [March 8, 2022, 8:45pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/15 "2022-03-08T20:45:11Z")

</div>

I stripped out the script in confirm page and re-typed the script on the page. Seems to be working now …

Hopefully, that fixes it.

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [March 8, 2022, 9:06pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/16 "2022-03-08T21:06:57Z")

</div>

Now it stopped working …

sigh …

There had to be something asmissed … I am not sure if I am missing something or not after reinstalling Mautic using compose instead of standard compressed files.

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [March 9, 2022, 11:09am UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/17 "2022-03-09T11:09:19Z")

</div>

> [@techbill](#):
>
> `https://mas.agwm.org/mtracking.gif`

I checked your tracking gif, seems to be working.  
Wierd.

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [March 9, 2022, 2:08pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/18 "2022-03-09T14:08:40Z")

</div>

I know …

It works sometime and it does not work sometime … just strange …

Do you think it have something to do about me testing it on the same computer with same browser but different email address?

I am using  
`<? if(isset($_GET['email'])) { echo " ;}; ?>`  
to prevent bot filling up my contact list.

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [March 9, 2022, 8:20pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/19 "2022-03-09T20:20:57Z")

</div>

We think we may know what going on because there were other area that our Mautic was having issue at like the segment contact etc.

When we lift the function restriction on some of the function like shell\_exec, the segment filtering start working again so maybe the same restriction was breaking this too.

Thanks for all you do!

---

<div class="post-metadata">

### Author: ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)
#### Post date: [March 15, 2022, 4:23pm UTC](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948/20 "2022-03-15T16:23:33Z")

</div>

It seems once the contact have confirmed then later deleted from Mautic. THat contact can no longer be re-tagged again if they fill out the form and click the confirmation link to direct to a page with the javascript to be assigned a tag.

When we deleted a contact then that contact can no longer opt in even if they go back and fill out the form again then click the link in email to go to the confirmation page. The tag will no longer assign to contacts that been deleted.

I already emptied the cache on Mautic and my browser also cleared the cookie. I was deleting contact to run the test again but it seems that once it been tagged before then it can never be tagged again after it been deleted.

Is there a way to reset that contact for testing purpose?

[Next page](https://forum.mautic.org/t/instant-opt-in-youtube-video-by-joey-keller/21948.md?page=2)
