# Link and image tracking in campaigns

**URL:** <https://forum.mautic.org/t/link-and-image-tracking-in-campaigns/25624>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [October 10, 2022, 4:37am UTC](https://forum.mautic.org/t/link-and-image-tracking-in-campaigns/25624 "2022-10-10T04:37:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![squareclamp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/squareclamp/32/8402_2.png) [@squareclamp](https://forum.mautic.org/u/squareclamp)\
**Post date:** [October 10, 2022, 4:37am UTC](https://forum.mautic.org/t/link-and-image-tracking-in-campaigns/25624/1 "2022-10-10T04:37:53Z")

</div>

**Your software**  
My Mautic version is: 4.43  
My PHP version is: 7.4  
My Database type and version is: MariaDB 10.3

**Your problem**  
Hi,

I’m very new to Mautic and try to get it working with my nginx configuration. I have most things working, but seems like my images / assets are not configured correctly. I’m using the Paprika email template and I don’t see the images load properly when the URL looks like - `https://mdev.com/index.php/themes/paprika/assets/paprikas.jpg?vb5bfa802`

However, if I remove the `index.php` the image loads fine but it does not show up as page hit when the email is opened by the client.  
``[https://mdev.com/themes/paprika/assets/paprikas.jpg?vb5bfa802`](https://mdev.com/themes/paprika/assets/paprikas.jpg?vb5bfa802%60)

Q1: Is this `https://mdev.com/index.php/themes/paprika/assets/paprikas.jpg?vb5bfa802` supposed to work? I couldn’t find any examples for nginx configuration, so any pointers would be helpful. I’m attaching my configuration for reference.

Q2: Another issue in the same email is I don’t see links being tracked, even though the default configuration does seem to have link tracking enabled. Is there anything extra I need to do to track emails?

nginx.conf.template

```auto
server {
        listen 80;
        listen [::]:80;

        server_name ${HOST};
        
        location / {
                rewrite ^ https://$host$request_uri? permanent;
        }
}

server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name ${HOST};

        index index.php index.html index.htm;

        root /var/www/html/mautic/docroot;

        server_tokens off;

        ssl_certificate /etc/letsencrypt/live/${HOST}/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/${HOST}/privkey.pem;

        ssl_session_timeout 5m;
        ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";

        client_max_body_size 4M;
        client_body_buffer_size 128k;
        
        index index.php index.html index.htm index.nginx-debian.html;
        
        location / {
            # try to serve file directly, fallback to app.php
            try_files $uri /index.php$is_args$args;
        }

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

        location ~* ^/index.php {
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            
            # Check that the PHP script exists before passing it
            # try_files $fastcgi_script_name =404;
            
            # try_files $fastcgi_path_info =404;
            # try_files $fastcgi_path_info $fastcgi_script_name =404;
            
            fastcgi_pass mautic:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            
            fastcgi_buffer_size 128k;
            fastcgi_buffers 256 16k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
        }
}

```

---

<div class="post-metadata">

**Author:** ![squareclamp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/squareclamp/32/8402_2.png) [@squareclamp](https://forum.mautic.org/u/squareclamp)\
**Post date:** [October 10, 2022, 4:27pm UTC](https://forum.mautic.org/t/link-and-image-tracking-in-campaigns/25624/2 "2022-10-10T16:27:14Z")

</div>

I think I might have found answer to question. It was my site url which had index.php in it. Now, I can view all images, but still don’t see image and and link clicks being tracked.

I’m testing using send email to contact.

---

<div class="post-metadata">

**Author:** ![squareclamp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/squareclamp/32/8402_2.png) [@squareclamp](https://forum.mautic.org/u/squareclamp)\
**Post date:** [October 10, 2022, 7:59pm UTC](https://forum.mautic.org/t/link-and-image-tracking-in-campaigns/25624/3 "2022-10-10T19:59:36Z")

</div>

Looking at the email source, the links seems to be correct -

```auto
https://mdev.com/r/cb3e2ede01e29f89617fbfc9b?ct=YTo1OntzOjY6InNvdXJjZSI7YToyOntpOjA7czoxNDoiY2FtcGFpZ24uZXZlbnQiO2k6MTtpOjE7fXM6NToiZW1haWwiO2k6MjtzOjQ6InN0YXQiO3M6MjI6IjYzNDQ0ZGM4NjFkYmMwNTUzMjE3OTkiO3M6NDoibGVhZCI7czoxOiI0IjtzOjc6ImNoYW5uZWwiO2E6MTp7czo1OiJlbWFpbCI7aToyO319&

```

and the redirects seem to work, but still don’t see tracking in campaign UI or contact profile

---

<div class="post-metadata">

**Author:** ![squareclamp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/squareclamp/32/8402_2.png) [@squareclamp](https://forum.mautic.org/u/squareclamp)\
**Post date:** [October 15, 2022, 9:03pm UTC](https://forum.mautic.org/t/link-and-image-tracking-in-campaigns/25624/4 "2022-10-15T21:03:43Z")

</div>

Found the problem, I was using same browser for testing emails. Opening in incognito worked.

h/t: [Link Tracking in Emails not working - #2 by joeyk](https://forum.mautic.org/t/link-tracking-in-emails-not-working/18655/2)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [October 17, 2022, 9:04am UTC](https://forum.mautic.org/t/link-and-image-tracking-in-campaigns/25624/5 "2022-10-17T09:04:30Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
