# Focus items in campaigns not working

**URL:** https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513
**Category:** Product Support
**Created:** [August 4, 2020, 3:33pm UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513 "2020-08-04T15:33:48Z")
**Posts on this page:** 12
**Page:** 2

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [December 13, 2021, 10:23am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/21 "2021-12-13T10:23:37Z")

</div>

I am revisiting this issue as I still have not been able to resolve it and it is driving me crazy :-(.

Are there any nginx people that have experienced this?  
We are running a focus item inside a campaign and it is not showing up as would be expected.  
I am wondering if this might be a nginx configuration problem.  
This is what I am seeing in the console

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/4a69d667a4f1b72ae2848dedb547f0ebd725a52d.png)

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [December 22, 2021, 10:56am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/22 "2021-12-22T10:56:10Z")

</div>

@robm and myself sat and debugged this issue and managed to get things working.

There are two issues here:

1. In the page visited Mautic is always expecting a trailing slash /
2. If you are running nginx and have used the configuration set out in linuxbabe article he is only allowing for 1.js to be passed through in the server rules:

```auto
   location ~ /(mtc.js|1.js|mtracking.gif|.*\.gif|mtc) {
       # default_type "application/javascript";
       try_files $uri /index.php$is_args$args;

```

Now my regex is not good enough to mess around with this so all I did was amend to this line the different focus items I wanted to allow to be served by the nginx server as follows:

```auto
   location ~ /(mtc.js|1.js|8.js|9.js|7.js|mtracking.gif|.*\.gif|mtc) {
       # default_type "application/javascript";
       try_files $uri /index.php$is_args$args;

```

I hope this helps others :-). Thanks @robm for assisting and finding the trailing slash 🙂

---

<div class="post-metadata">

### Author: ![tancredi](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@tancredi](https://forum.mautic.org/u/tancredi)
#### Post date: [August 19, 2022, 9:44am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/23 "2022-08-19T09:44:28Z")

</div>

Just wondering here, is it possible to show focus items without being tied to a campaign?

Still having the same problem, tried in different browsers, focus items doesn’t load.

Can anyone share a solution to this?

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [August 21, 2022, 6:51am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/24 "2022-08-21T06:51:05Z")

</div>

Hi There,

Yes you can have focus items outside of a campaign, all you need to do is make sure you have inserted the code in the page you want it to load, or to do it via google tag manager.

A few points to keep in mind when testing:

1. Make sure you are not logged into Mautic when testing.
2. Make sure your CORS is enabled to the site you want to focus item to load.

if it is not loading are you seeing any errors in the the console or any logs ?

Off topic to your question, but on topic for this post I have an update on the config of nginx

```auto
 location ~ /(mtc.js|*\.js|mtracking.gif|.*\.gif|mtc) {
       # default_type "application/javascript";
       try_files $uri /index.php$is_args$args;

```

---

<div class="post-metadata">

### Author: ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)
#### Post date: [January 13, 2024, 5:24am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/25 "2024-01-13T05:24:17Z")

</div>

Hello Joey,

I’m jumping in here because I think I have a similar problem.

I’m also currently testing the focus items in a campaign and I’m not getting any output on the page. If I include the focus item script it works without any problems.

I have defined a very simple campaign: Contact Segment → Page Visit (with URL: \*) → Show Focus Item.

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/76337a6c2c92bd33cddb5b02d7c1b2d794335a1c.png)

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/fbeb744e8007a2b2de1f9619dc33b556edfb0854.png)

In the contact, the focus item is also given to me as “Campaign action triggered”.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/4b1f2deffec63035a9177632e3d90635bc0bb683.png)

However, I don’t see anything on the page. I’m testing it locally in an incognito browser, have CORS turned off. I don’t see any errors in the console. The normal event is output in the network requests when the page is accessed.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/d4bb7a91a841186881f965985def08addd90350e.png)

Do you have any ideas as to why the focus item isn’t being visible for me?

Best regards

Timo

---

<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: [January 13, 2024, 8:45am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/26 "2024-01-13T08:45:13Z")

</div>

Are you using the same browser for testing as admin? Remember: an admin gets an admin cookie, and tracking won’t work. It means, that you’ll never fulfill the ‘visited page’ event.

Try to clear the cookies, and or use another browser for testing.

---

<div class="post-metadata">

### Author: ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)
#### Post date: [January 13, 2024, 10:18am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/27 "2024-01-13T10:18:12Z")

</div>

Hi Joey,

thanks for your reply. I use the same browser but do the testing in an inkognito tab. So I think there should be no cookie problem.

---

<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: [January 13, 2024, 11:19am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/28 "2024-01-13T11:19:01Z")

</div>

Can you find the test contact in Mautic among anonymous contacts and paste here the list of events?

---

<div class="post-metadata">

### Author: ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)
#### Post date: [January 14, 2024, 7:23pm UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/29 "2024-01-14T19:23:46Z")

</div>

Hello Joey,

Thank you for your feedback signal. I forgot the picture yesterday.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/4b1f2deffec63035a9177632e3d90635bc0bb683.png)

In my test case, however, it is not an anonymous contact but a segment with a group of specific contacts. So one of these contacts, I’m logged in incognito and unfortunately I don’t see the focus item.

---

<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: [January 14, 2024, 9:34pm UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/30 "2024-01-14T21:34:21Z")

</div>

But if you are in incognito, then how do you know, that this contact is identified and the page view is acknowledged?

---

<div class="post-metadata">

### Author: ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)
#### Post date: [January 15, 2024, 7:52am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/31 "2024-01-15T07:52:53Z")

</div>

Hello Joey,

Thank you for your feedback signal. Yes, I can understand your query, please excuse my inaccurate explanations.

The reason is that I log in to our site and the user is identified through it.

I send the user’s UUID with the tracking data:

```auto
trackingData = {
    pb_uuid: app.$auth.user.id,
};
mt('send', 'pageview', trackingData);

```

Accordingly, we have a custom field pp\_uuid which is publicly updatable and also a unique identifier.

So if I log in as a user and then move around the page, these page views are recognized and displayed in the contact in Mautic.

---

<div class="post-metadata">

### Author: ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)
#### Post date: [January 15, 2024, 10:06am UTC](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513/32 "2024-01-15T10:06:08Z")

</div>

I just saw in the tracking script request that it appears to contain data for the focus item. Unfortunately nothing/no focus item is displayed.

 ![Auswahl_016+](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/25ce0e395a0331253c3520113011d55964f78f04.png)

[Previous page](https://forum.mautic.org/t/focus-items-in-campaigns-not-working/15513.md?page=1)
