Simultaneous Tracking and Reporting - Is It Possible


(Roddy A. Stegemann) #1

OBJECTIVE: Display information about a visitor to a visitor while he is on the page.

BACKGROUND: In order to achieve this objective I must be able to match the visitorId of the current visitor with his visitorId in the database, else I risk passing private information to the wrong person.

QUESTION: Could someone provide a strategy to achieve this goal?

Roddy


(Lukas Winkler) #2

Hi,

While it would be really nice to combine both (maybe by sending back the data on the tracking request), this isn’t possible yet.
Maybe someone wants to write a plugin that adds this functionality as I think I have read this idea before.


(Roddy A. Stegemann) #3

Thank you for responding, Lukas.

I believe that it is possible, and I also believe that I have found the way short of one important missing link that hopefully you can supply: how to access the Matomo Request class with strict PHP?

Do I use an include statement? Is there a namespace that I must consider? Where do I discover the necessary information that makes this possible?

In liberty,

Roddy

p.s. In fact, I have made it work while calling on my webpages host server from my local test server. Simply, I cannot yet get it to work when the call to Matomo is made from the same server on which Matomo resides.


(Lukas Winkler) #4

Hi,

I am not sure, but I think including the Matomo PHP files will end up as a mess.

I’d try to write a plugin inside of Matomo that provides exactly what you need as an API:
https://developer.matomo.org/develop


(Roddy A. Stegemann) #5

I am happy to report that it is possible to report back to visitor’s their own information. This is achieved with two AJAX calls to two separate PHP files: one to obtain the IP address of the current visitor, and the other to retrieve the Matomo information related to the retrieved IP address. What makes this work is the

API.getIpFromHeader()

method. It took me two full days to discover it, but it does exist. I will post a link to its power as soon as the page is complete. First I must come to terms with my host server about another issue.

It is a win-win relationship for entrepreneur and visitor. For, it provides the entrepreneur with what he needs to succeed, and shares this success directly with his visitors by serving as a mirror to their own behavior. It also plays up to the visitor’s vanity and thus discourages him or her from opting out, thus avoiding crushing government oppression.

Hooray! Hooray! Hooray!

In liberty,

Roddy

p.s. It is not perfect, but maybe with a timestamp it will be near perfect.


(Roddy A. Stegemann) #6

OK. This is what I have achieved so far. It is quite humble in what it reports, but from it you can see its reporting potential.

Go to the Grammar Captive mainpage, find the subheading Your Profile in the navigation bar on your left, click on the phrase Your Data and You, and wait a moment. While you are waiting read the explanation that appears when you click.

Any feedback with regard to this implementation would be greatly appreciated. For example, I am unsure that the IP address alone is sufficient to identify the visitor, when it is requested by the visitor from his own browser window.

Roddy