Mautic Community Forums

Problem with Lead Tracking

Hi everyone,



I’m trying to track logged in users & update their points based on the pages they view.



Now, either I’m missing something huge or there is some bug around.



I added tracking pixel to every page on my project. The tracking pixel is similar to this:

Code:
$mautic_tracking_pixel_data = urlencode(base64_encode(serialize(array( 'page_url' => $_SERVER['REQUEST_URI'], 'email' => $customer_data->email // Use your website's means of user management to retrieve the email ))));

<img src="https://domainero.mautic.com/mtracking.gif?d={$mautic_tracking_pixel_data} style=“display: none;” />


This code doesn't recognize user by Email and instead shows that visitor was Anonymous. I tried this code as well:
Code:
https://domainero.mautic.com/mtracking.gif?page_url=http%3a%2f%2fyourdomain.com%2fyour-product-page&page_title=Some Cool Product&email=a@example.com

This didn't work either at firs and after a bit of google-ing, it turned out I need to make the "email" field Publicly Editable which apparently produced some problems on its own.

Now, my question is - what do I need to do in order to track & identify logged in users?

What I'm trying to do is to simply increase user's Points on each page visit and I'm having really hard time achieving this ...

Any ideas?

Thanks

@domainero There is a bug in 1.2.0 which doesn’t save lead data unless a tags attribute is present in the URL query. Here is the fix which will be available in 1.2.1:

https://github.com/mautic/mautic/pull/885

Hi everyone,

I’m trying to track logged in users & update their points based on the pages they view.

Now, either I’m missing something huge or there is some bug around.

I added tracking pixel to every page on my project. The tracking pixel is similar to this:

$mautic_tracking_pixel_data = urlencode(base64_encode(serialize(array(
            'page_url'   => $_SERVER['REQUEST_URI'],
            'email' => $customer_data->email // Use your website's means of user management to retrieve the email
        ))));

<img src="https://domainero.mautic.com/mtracking.gif?d={$mautic_tracking_pixel_data} style="display: none;" />

This code doesn’t recognize user by Email and instead shows that visitor was Anonymous. I tried this code as well:

https://domainero.mautic.com/mtracking.gif?page_url=http%3a%2f%2fyourdomain.com%2fyour-product-page&page_title=Some Cool Product&email=a@example.com

This didn’t work either at firs and after a bit of google-ing, it turned out I need to make the “email” field Publicly Editable which apparently produced some problems on its own.

Now, my question is - what do I need to do in order to track & identify logged in users?

What I’m trying to do is to simply increase user’s Points on each page visit and I’m having really hard time achieving this …

Any ideas?

Thanks

@domainero ,
As you mentioned, the email field needs to be publicly editable.
However, the lead has to already exist in the leads list. Right now, Mautic needs a formal input of a lead, either via a form or a list input. So you will have to work out the handshake from your site to mautic somehow before the lead gets tracked.