Lead Monitoring
The act of monitoring the traffic and activity of leads can sometimes be somewhat technical and frustrating to understand. Mautic makes this monitoring simple and easy to configure.
Website Monitoring
Monitoring all traffic on a website can be done by adding a single tracking pixel to the website. It is important to note that traffic will not be monitored from logged-in Mautic users. To check that the pixel is working, use an incognito or private browsing window or simply log-out of Mautic prior to testing.
http://yourdomain.com/mtracking.gif
Tracking Pixel Query
To get the most out of the tracking pixel, it is recommended that you pass information of the web request through the image URL.
Page Information
Mautic currently supports page_url , referrer , language , and page_title (note that the use of url and title are deprecated due to conflicts with lead fields).
UTM Codes
Support for UTM codes in the lead time-line was introduced in version 1.2.1. utm_medium , utm_source , and utm_campaign
are used to generate the content of the time-line entry.
utm_campaign will be used as the time-line entry's title.
utm_medium values are mapped to the following Font Awesome classes:
Values Class
social, socialmedia
fa-share-alt if utm_source is not available otherwise utm_source will be used as the class. For example, if utm_source is Twitter, fa-twitter will be used.
email,
newsletter fa-envelope-o
banner, ad fa-bullseye
cpc fa-money
location fa-map-marker
device fa-tablet if utm_source is not available otherwise utm_source will be used as the class. For example, if utm_source is Mobile, fa-mobile will be used.
Lead Fields
You can also pass information specific to your lead by setting Mautic lead field(s) to be publicly updatable. Note that values appended to the tracking pixel should be url encoded (%20 for spaces, %40 for @, etc).
Tags
The lead's tags can be changed by using the tags query parameter. Multiple tags can be separated by comma. To remove a tag, prefix it with a dash (minus sign).
For example, mtracking.gif?tags=ProductA,-ProductB would add the ProductA tag to the lead and remove ProductB.
Embedding the Pixel
If you are using a CMS, the easiest way is to let one of our plugins do this for you (see below). Note that the plugins may not support all lead fields, utm codes or lead tags.
Here are a couple code snippets that may help as well: HTML
PHP
$d = urlencode(base64_encode(serialize(array(
'page_url' => 'http://' . $_SERVER[HTTP_HOST] . $_SERVER['REQUEST_URI'],
'page_title' => $pageTitle, // Use your website's means of retrieving the title or manually insert it 'email' => $loggedInUsersEmail // Use your website's means of user management to retrieve the email
))));
echo '<img src="http://your-mautic.com/mtracking.gif?d=' . $d . '" style="display: none;" />';
Javascript
<script>
var mauticUrl = 'http://your-mautic.com';
var src = mauticUrl + '/mtracking.gif?page_url=' + encodeURIComponent(window.location.href) + '&page_title=' + encodeURIComponen var img = document.createElement('img');
img.style.width = '1px'; img.style.height = '1px'; img.style.display = 'none'; img.src = src;
var body = document.getElementsByTagName('body')[0]; body.appendChild(img);
</script>
Available Plugins
Mautic makes this even easier by providing key integrations to many existing content management systems. You can download and use any of the following plugins to automatically add that tracking pixel to your website.
Joomla! Drupal WordPress Typo3 Concrete5
These are just a few of the integrations already created by the Mautic community. More will be added in the future and
developers are encouraged to submit their own integrations.
Note: It is important to note that you are not limited by these plugins and you can place the tracking pixel directly on any HTML page for website tracking.
Mobile Monitoring
The essence of monitoring what happens in an App is similar to monitoring what happens on a website. Mautic contains the building blocks needed for native (or pseudo-native) and HTML5-wrapper based Apps, regardless of platform.
In short, use named screen views (e.g. main_screen) in your App as your page_url field in the tracker, and the lead's email as the unique identifier, see next section for detailed instructions.
Steps in Mautic
Make the email field publicly editable, this means that a call to the tracking GIF with the variable email will get properly recognized by Mautic.
Setup a form, which will be the access point of your campaign (e.g. a new lead email). Make this form as simple as you can, as you will be POST-ing to it from your App. The typical form URL you will POST to is
http://your_mautic/form/submit?formId=
You can get the ID from the mautic URL as you view / edit the form in the Mautic interface (or in the forms tables, last column), and you can get the form fields by looking at the HTML of the 'Manual Copy' of the HTML in the forms editing page.
1. Define in your campaigns the screens you want to use as triggers (e.g. 'cart_screen' etc.). Mautic is not looking for a real URL in the form 'http://' for page_url, any typical string would do. Like this:
http://yourdomain.com/mtracking.gif?page_url=cart_screen&[email protected]
In your App
A best-in-class approach is to have a class (say 'mautic') that handles all your tracking needs. For example, this sample method call would POST to the form with ID 3 - see previous section (note: for conciseness and ubiquity, these sample lines are written in JavaScript / ECMAScript-type language, use similar call in your mobile App language of choice).
mautic.addLead("[email protected]",3)
And then, to track individual user activity in the App, this sample call would make an HTTP request to the tracker:
mautic.track("cart_screen", "[email protected]")
Which is nothing more than an HTTP request to this GET-formatted URL (as also shown in previous section):
http://yourdomain.com/mtracking.gif?page_url=cart_screen&[email protected]
Important: Make sure in your App, that the above HTTP request is using a cookie (if possible, re-use the cookie from the mautic.addLead POST request prior) AND that you reuse this cookie from one request to the next. This how Mautic (and other tracking software) knows that it's really the same user. If you can't do this, you may run in the (unlikely but possible) case where you have multiple leads from the same IP address and Mautic will merge them all into a single lead as it can't tell who is who without a cookie.
Other Online Monitoring
There are several other ways to monitor lead activity and attach points to those activities. Website monitoring is only one way to track leads. Other lead monitoring activities can consist of forum posts, chat room messages, mailing list discussion posts, GitHub/Bitbucket messages, code submissions, social media posts, and a myriad of other options.
Troubleshooting
If the tracking doesn't work, take a look at Page troubleshooting or Email troubleshooting