Mautic Community Forums

mtc.js not found

Hallo!



I’m trying to add the javascript tracking instead of the pixel tracking on my own website. I recently updated to 1.4. But it looks it can’t find the mtc.js in the mautic site. (I also can’t find it, but well, if it’s like the pixel URL that actually gets generated dynamically…). What I think is that I miss some step while upgrading the version. I just pulled from git, checkout on 1.4.0 and did some symfony commands to update the db and clear cache. Is there anything missing?



Thx for the help!

Where do you put this line of code?

So, this had nothing to do with installation process or anything.

My nginx configuration was quite restrictive, and for all the assets (images, js, css) was just trying to “get the file”. Since the file does not exist, there was nothing to return. Error. What I had to do is change Nginx configuration so it executes PHP, instead of just looking for a file!

Something like this:

location ~ mtc.js{ try_files $uri @phpstream; }

This kind of problem might happen with the mtracking.gif. Just take into account your nginx configuration.

Hallo!

I’m trying to add the javascript tracking instead of the pixel tracking on my own website. I recently updated to 1.4. But it looks it can’t find the mtc.js in the mautic site. (I also can’t find it, but well, if it’s like the pixel URL that actually gets generated dynamically…). What I think is that I miss some step while upgrading the version. I just pulled from git, checkout on 1.4.0 and did some symfony commands to update the db and clear cache. Is there anything missing?

Thx for the help!

francescjr’s answer is missing the named location @phpstream. What do you place in that location francescjr?
fastcgi_pass unix:/path-to-your-php-fpm.sock?

Here’s what I ended up using (Place in your nginx config file)

[code]location ~ mtc.js {
try_files $uri @phpstream;
}

BE SURE TO PLACE THIS OUTSIDE OF ANY OTHER LOCATION BLOCK.

location @phpstream {
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
[/code]

See this link for reference on the @ symbol use in Nginx configuration: http://serverfault.com/questions/738452/what-does-the-at-sign-mean-in-nginx-location-blocks

Hello,
I added this code in my Nginex settings but my server stopped!
My server is debian and this is with the easy engine.

can you help me ?

my nginx config is to listen to 127.0.0.1:9000, I used these code below but not work :frowning:

[code]location ~ mtc.js{
try_files $uri @phpstream;
}

location @phpstream {
fastcgi_pass 127.0.0.1:9000;
}[/code]