Mautic Community Forums

Mtracking.gif issue with IIS

Your software
My Mautic version is: 3.1.2
My PHP version is: 7.3.24
My Database type and version is: 10.5.4-MariaDB
IIS 10.0

Hi, I’m trying to get tracking working on a 3rd party website. I have added the php code and I did get a Mixed Content warning because my local version of Mautic is http and the 3rd party site is https. I don’t know if that was stopping the re-direct or not, but I also just copied the value for the redirect link and manually went to the url and it loaded up the mtracking.gif without errors but still doesn’t insert a record into the page_hits table or show anything in the UI about the view.

$page_url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$pageTitle ='My Website';  
$email = getEmail();
$d = urlencode(base64_encode(serialize(array(
    'page_url'   => $page_url,
    'page_title' => $pageTitle,    // Use your website's means of retrieving the title or manually insert it
    'email' => $email // Use your website's means of user management to retrieve the email
))));
echo '<img src="http://mauticpoc:8080/mtracking.gif?d=' . $d . '" style="display: none;" />';

One note, Mautic is currently running locally and not public facing. Would that cause any issues? I could see it causing issues if we actually implemented and whoever was accessing our 3rd party site wouldn’t be able to access the local version. However as stated I can access the local version and copying the URL with parameters still doesn’t show the tracking.

Also we are currently using IIS, I did find a web.config file that seems to be working for all re-directs here How i Solve problems on IIS (500 and 404) but I don’t know if it’s maybe missing something else for the tracking that needs to be enabled on IIS?

I also did alerts for the 3 values, page_url, page_title, and email and all seem to be returning the correct values.

Thanks,