I just installed a self-hosted version of Mautic. It’s located in “root/mautic/”
I’m trying to get the tracking pixel working but as far as I can tell, the only tracking I’m getting is from a form I set up and from emails.
I’ve manually inserted the following codes, hoping one of them might work:
Code:
I followed this documentation: https://www.mautic.org/docs/leads/lead_monitoring.html as well as a few different threads on this forum but to no avail, none of my codes seem to be registering.
I've also tried visiting the page using different browsers and on networks I'm not logged into Mautic on, no luck yet.
None of the codes you created are in the proper format. As shown in the documentation you linked too, the tracking pixel must be serialized and base64-encoded. There’s a PHP example on the documentation which shows how to do that.
The next thing you need to do is past the data in the serialized / encoded values as the “value” of the ‘d’ url query parameter:
Okay, I see what I was doing wrong. I wish the documentation was a little more explicit about what needs to be done.
I’m still not seeing any tracking though. I copied the code from the example, and updated it so the correct variables are being passed and it’s still not registering. My code looks like:
[code]$d = urlencode(base64_encode(serialize(array(
‘url’ => $_SERVER[‘REQUEST_URI’],
‘title’ => $TITLE, // Use your website’s means of retrieving the title or manually insert it
‘email’ => $_SESSION[‘email’] // Use your website’s means of user management to retrieve the email
))));
I copied the URL of Mautic and placed it in my code (because my variable was storing the wrong URL for this):
[code]$d = urlencode(base64_encode(serialize(array(
‘url’ => $_SERVER[‘REQUEST_URI’],
‘title’ => $TITLE, // Use your website’s means of retrieving the title or manually insert it
‘email’ => $_SESSION[‘email’] // Use your website’s means of user management to retrieve the email
))));
echo ‘’;[/code]
…and I’m still not seeing any tracking happening. I am getting the 404 error. Any thoughts on where to start to debug this?
If you’re getting a 404 and you’re sure the path is correct its possible your .htaccess file is not set up correctly. The mtracking.gif file is not a real, physical file. It’s dynamically created and served via mautic and some php handlers.
Can you check your apache error logs to see if there’s any errors related to mod_rewrite?
Figured it out. There was no .htaccess file included in my download of Mautic. I created the file in the Mautic installation folder. Tracking is now working.
Thanks for your help on this Chad, best response time I’ve ever seen on a forum!
Ah yay! I was just going to post to tell you to check for the .htaccess file. It should be included - its possible that it didn’t get uploaded or that your host actually deleted it (I’ve seen that!).
Sorry to jump onto the end of this thread and if it is a dumb set of questions.
I have just installed Mautic on my site and now wanting to set up the basics, but I am lost at square one with the tracking pixel.
I have a standard .php site - not Wordpress, Drupal, etc.
It would therefore seem that I will need to use the code as described above, i.e.;
[code]$d = urlencode(base64_encode(serialize(array(
‘url’ => $_SERVER[‘REQUEST_URI’],
‘title’ => $TITLE, // Use your website’s means of retrieving the title or manually insert it
‘email’ => $_SESSION[‘email’] // Use your website’s means of user management to retrieve the email
))));
echo ‘’;
[/code]
So my questions are;
I presume that I just enter the above code on my page encased with the normal <?php ?> php tags?
Is there any specific area to place the code - above the tag, in the or the ?
Does that code have to go onto every page on my site that I want tracked or just my main index.php page?
What if I have marketing that takes people to landing pages and not the main index?
I presume the ‘title’ is the page title for each page that I have that code on?
I don’t understand the significance of the ‘email’ variable. You say ‘Use your website’s means of user management to retrieve the email’ - but what eMail are you talking about here? What eMail is generated and what is its purpose? Is it an actual eMail address or something else such as ‘PHP Mail()’ or ‘PHPMailer’ etc?
Also one more question off topic while I am here, with the cron jobs, how often do you recommend that they are run?