Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi everyone,
I want to create a dashboard that shows the statistic of unique visitors visit and the duration of it on certain Mashup. Do you have any idea to implement this?
What I have in mind is:
> Creating a database that records the visitors name and current time and everytime a mashup is opened
> And also record the current time when a mashup is closed (which I'm not so sure whether this is possible or not)
Anyway feel free to give me your idea! I'm looking forward to your ideas!
Solved! Go to Solution.
Eventually I developed a simple javascript function that every xx seconds will call a Thingworx service via REST API Call and this includes all information I want to transmit to my sql database. I wrap this function to a extension and upload/import it to my thingworx server, so that every time a mashup is opened this js function will be called and running in the backgrounds. I additionally uses a user session so that every opened tab will be handled uniquely. To count up the duration of usage I just update my sql database by incrementing the same session id by xx seconds and it works a I expected
Hello,
I think your use case sounds interesting so I've been trying to find a way to see when a mashup has been closed.
But unfortunately I haven't been able to find it.
I did find some similar posts so perhaps you can find some inspiration from them:
https://www.ptc.com/en/support/article/CS288073
But I don't think they really fully work for you.
Looking forward to see if anyone else has any ideas.
Regards,
Jens
I never did such a thing, therefore just some brainstorming ideas:
I created similar functionality for the old Widget CSS configurator, which shows the count of mashup reads. In my case, if the user loads up a Mashup, it will log an entry like this: "DateTime,MashupName".
I can extent this to the service execution count - just add a row "DateTime,ServiceName" (just make sure you don't record services triggered by AutoRefresh as well).
I don't care that much how many times they spend on the mashup in my case, because users might simply leave the mashup open, which would result in dirty metrics.
Functionality to collect Mashup usage statistics in ThingWorx Platform PTC article regarding this feature -> "reported as enhancement"
https://www.ptc.com/en/support/article/CS266487
This article introduce how to trace login/logout history where you can calculate the statistic of unique visitors visit then display on mashup.
Eventually I developed a simple javascript function that every xx seconds will call a Thingworx service via REST API Call and this includes all information I want to transmit to my sql database. I wrap this function to a extension and upload/import it to my thingworx server, so that every time a mashup is opened this js function will be called and running in the backgrounds. I additionally uses a user session so that every opened tab will be handled uniquely. To count up the duration of usage I just update my sql database by incrementing the same session id by xx seconds and it works a I expected