PIWIK Store visits per User ID as well as or instead of per IPs - matomo

I have piwik to track my website visits. My website has a login page and I would like to do the analysis per userid, not necessarily per IP. Is there a way where piwik can store my user session variable in order me to know exactly which users used a determined page?
Thanks in advance.

The way to do this is via custom variable.
Basic Code:
piwikTracker.setCustomVariable(1, "Member", "<?php echo $username;?>", "visit"); piwikTracker.trackPageView();
visit scope will last for the session
Piwik Docs at:
http://piwik.org/docs/custom-variables/

Instead of using a custom variable, you could use Piwik's built-in User ID feature, which also has the added benefit of allowing Piwik to more accurately track uniques.

Related

Angular and NodeJs: Is passing id (generated in mongodb database) in the URL a wrong way of keeping track of users

I am using MEAN stack.Normally to collect data of a particular user I normally pass ID generated in mongodb database through $location.path in angular controllers, so the url contains the id's of my users .
But I don't know whether this is a secured way of doing things.
So can someone help me out what should be my approach.
`
Considering your last comment, when talking about an administrator reviewing a user's details for instance, yes it is the way to do it, like any resource from your database.
You may have an url like https://mycompany.com/users/{user's id} for instance, just be careful about the access rights.

Integrate SurveyMonkey in an existing community

I have a cakePHP community. User are able to signup and login. I like to create a survey using SurveyMonkey.
Therefor I create the survey and make it available to my members using the direct URL. In my member database I have to save the information "did completed the survey = yes/no".
Is there any way to identify the user filling in the survey and write this information into the database?
SurveyMonkey has an API https://developer.surveymonkey.com/ , that let you collect info from your survey (completedf or not).
This is the only way i think, (if it s not include in your website).
I know that you can simply do this with Examinare Survey Tool. What you do first is that you use the API inside Examinare to add a recipient for all the users in the survey base.
Use the PHP Wrapper library in their developer site.
Loop it through and use the https://developer.examinare.com/php-wrapper-library/ and use the example code.
If you let people register with same email more than 1 time then save the ContactID into your database on the recipient.
Then to not create an email invite you use this : markrecipientstosurvey
The surveyID is available inside the Examinare account.
When you done this script part then make it as a cronjob for instance inside the crontab -e
I would run it every 30 minutes or 1 per hour.
Next part you create a page for the survey redirect where you use the function: listsurveysbyuser
to get the survey version and url
(there is a special link for the mobile user that even works for the normal mobile phone NOT only smartphones)
Now you just redirect them to the survey. If you want them to return to your site after then you use the redirect_url parameter that is added to the url or use the redirect inside your account. Ask support about that if you need :) They are fast... Never had to wait more than a couple of minutes.
When the person return then just check if they are marked as complete with the same api call: listsurveysbyuser
Looks much but it is very easy to implement and if you have any problems then just ask the support at support#examinare.com I have asked alot and never had them to say that it can not be done. Really nice!
EDIT:
I see that they just released a tutorial much better than my example:
https://developer.examinare.com/how-to-use-surveys-in-cakephp-with-very-little-development/
One option:
Use unique Custom Variables in the URL that is visited by each member of the community
For example, https://www.surveymonkey.com/s/your_survey?userid=$my_user_id
Note that you can create weblink or email collectors with the API (endpoints: create_flow or create_collector).
Then track the responses using the get_respondent_list or get_responses endpoints of the API.
Note: Please confirm with the Survey Monkey API team that the custom variables can be read via the API.
Another option:
Use the email collector (create_flow) API endpoint and send it to your members' email addresses.

API: how can I get the origin of the visitor specified by custom variable?

We're tracking our visitors by Piwik and I find it great.
However, I'm facing some difficulties using the APIs, especially with custom variables.
What I need to get is the very first origin of some registered user.
Imagine the flow:
an anonymous user comes to our website from somewhere (this is displayed on the frontend under the 'visitor log -> first visit -> from' section)
the user then registers (maybe) and starts using our website as an authenticated user, and we pass a custom variable called 'username' to Piwik.
How can I get the origin of the visitor - from where he came - programmatically? I don't actually know when the user first came to the website. I want to create some kind of a function which would take only the user's username and return his origin (ie. the URL of the site from which he came).
Any help appreciated.
Thank you!

Get user name and basic detail without using facebook graph api

I am working on a website, I have one problem ..
I have facebook users id in my database, now I want to get their names using their ids but without using graph api..
Is there any way to do so..
I assume you want to do this programaticaly... Short answer is - you can't.
If you want to do it manually you can simply navigate to this url: https://facebook.com/profile.php?id={USERS_ID}It will give you the users profile page where you can see their name IF their profile is publicly available.
Essentially you should request the users names and store them in your database when the users authenticate your application.

Is it possible to access a user's Google +1 (Plus One) history via an API?

I would like to access a user's Google Plus One history
With +1 enabled, the history is saved in your Google profile and optionally can be displayed:
http://www.google.com/+1/button/
It is possible to access this programatically (once the user has given permission via normal Google Authentication and Authorization?)
I have only been able to find information for the API to add the button to sites.
You can allways try to parse the data used by G+ itself.
The G+ user profile has a tab with all public +1, that can be fetched with
https://plus.google.com/_/plusone/get?oid=<google-plus-id>
It seems to be related to JSON, but with some differences.
Check this out....
https://developers.google.com/+/history/
Dave,
I'm not sure about a user's history, but the count for particular URL is available via a JSON-RPC service (https://clients6.google.com/rpc). Here's a little post on how to:
http://www.johndyer.name/post/Getting-Counts-Twitter-Links-Facebook-Likes-Shares-and-Google-Plus-One-Buttons.aspx
I'm guessing that same service can get additional data, but I can't find any public documentation either.

Resources