Mautic Community Forums

Logged in users

Hi,



I just found Mautic today and I am very happy I did. It looks very promising.

My questions are about ways of getting lead data into Mautic.



As far as I understand tracking pixels can only track basic visit info that is available at server log level. Is there any mechanism planned for adding additional info either via additional params on the pixel(ex. ?name=john&lastname=doe) or via javascript.



An example use case would be a website with user accounts. After login most analytics and other tools that require tracking have mechanisms that allow you to identify the visit via javascript and pass on any data about the user that we have available on our website.

I guess this can be done server-side via oauth but not client-side via javascript at the moment?



Since the forms seem to be embedable via javascript is there a way to just post the data directly from javascript without a form?



Thanks for all your hard work,

Miha

Hi,

I just found Mautic today and I am very happy I did. It looks very promising.
My questions are about ways of getting lead data into Mautic.

As far as I understand tracking pixels can only track basic visit info that is available at server log level. Is there any mechanism planned for adding additional info either via additional params on the pixel(ex. ?name=john&lastname=doe) or via javascript.

An example use case would be a website with user accounts. After login most analytics and other tools that require tracking have mechanisms that allow you to identify the visit via javascript and pass on any data about the user that we have available on our website.
I guess this can be done server-side via oauth but not client-side via javascript at the moment?

Since the forms seem to be embedable via javascript is there a way to just post the data directly from javascript without a form?

Thanks for all your hard work,
Miha

Hi Miha!

Excellent questions and suggestions!

For the additional info mechanism, we do support some! You can pass the following as part of the query to the tracking URL:

Saved to the page hit record:

  1. referrer
  2. language
  3. title

Saved to the lead record:

  1. email
  2. firstname
  3. lastname

You can pass them as clear text (i.e ?firstname=john) or if you have access to PHP and prefer to mask what’s passed, you can encode it with php by doing:

$query = array(
    'firstname' => 'john',
    'lastname' => 'smith'
);
$encoded = urlencode(base64_encode(serialize($query)));
$trackingPixel = 'http://my.mautic.com/p/mtracking.gif?d=' . $encoded;

While I’m looking at that bit of code, I’m going to add the option to accept any custom lead field as it’s a super easy code addition and will be valuable so that’ll be in the next release :slight_smile:

As for submitting forms with javascript, it’s definitely possible but not implemented yet :slight_smile: It takes a little more work as you’ll have to tell Mautic what domains or okay to accept data from. Would you be willing to create a feature request for this at https://github.org/mautic/mautic/issues?

Thanks!
Alan

Hi,

Wow, thanks, that’s a level of support commercial projects can only dream to have some day!
I can see the changes are already on Github and not only that, you can mark each custom field as publicly submittable or not. Beautiful.
Is it ok to add the extra params to the tracking pixel on every request after the user logs in?
How are visits from different browsers or devices merged once identified? With forms there is an option to choose which field the lead is merged on, what would happen in case of tracking a logged in visitor via the tracking pixel params, that logs in from different devices, would the lead be merged based on email by default or would there be two leads with the same email in the system? Can one lead have multiple tracking ids(stroed in cookies on different devices) or is a lead tied to one cookie?

Before I submit a Github issue for js form submission I would like to ask you if there is a javascript tracker planned?
I think javascript based tracking can offer much more flexibility so it can be customised for specific use case. It would for example be possible to tag or target fields in an existing signup form and submit them to Mautic at the same time the user registers on a site. It would be possible to track ecommerce actions or similar.
Are custom events(like user watched a video, posted a comment, made a purchase,…) and complex behavioural tracking something that is out of scope for Mautic(as there would soon be problems with scaling and limits of traditional databases) or is this something that is on the roadmap?
Someone mentioned Segment support. Looking at how Segment abstracts all the different tracking APIs can help you construct your own javascript tracking library in a way that people already understand and are used working with.

I’m sorry I have so many questions and suggestions I have to bite my fingers to stop writing.
I really have to say that I’m impressed by this project. It moves faster, is better structured and very well documented and on top of that you don’t mess around and just do stuff that makes sense. I wish you all the best!

Thanks,
Miha

Hi Miha,

It shouldn’t hurt anything to pass in on every request.

There isn’t currently a compiled list of browsers or devices used by the leads. That information is accessible and can be generated using reports. If an anonymous lead becomes identified, their previous history will still be associated with the identified lead.

Looking at the code, I think you’ve pointed out an issue here. Unlike forms, we are not checking for an existing email here and so a new one will be created if they do not already have a tracking cookie. I’ve created this as an issue at https://github.com/mautic/mautic/issues/98 and will get it addressed for the stable release.

[quote]Can one lead have multiple tracking ids(stroed in cookies on different devices) or is a lead tied to one cookie?
[/quote]One lead can have multiple tracking IDs if accessing from multiple devices. A tracking ID is good for 30 minutes of inactivity before it’s considered “expired.” Tracking IDs are used to group together current browsing ‘sessions.’ Once we fix the above issue though, the same lead will be used if passing the same email (or if the lead already has a lead tracking cookie).

Yes! We recognize the downfalls of using the image only so we are definitely planning to develop a JavaScript solution to make it more robust.

Does that help answer the questions or did I make it clear as mud :slight_smile:

Thanks!
Alan