analytics

How to track user time on site

前提是你 提交于 2019-12-02 16:22:26
I'm looking to track users average time on a website (in the same way that Google analytics does) for internal administration. What's the easiest way to do this? Dmytro Krasun You can get the time in next ways: Once user visit your site, save current time at cookie as "visited", and at next visit you can grab it, if it was set. And more expensive method: when the page loads, start js timer, and on page unload send to server time which user sent and save it to db. And if window.unload does not work at Opera, you can send time to server every 5 seconds, and stores it to DB. If you need, I can

Best place to insert the Google Analytics code [duplicate]

为君一笑 提交于 2019-12-02 15:44:55
This question already has an answer here: Should I put the Google Analytics JS in the <head> or at the end of <body>? 6 answers Where’s the best place to insert the Google Analytics code in WordPress, header or footer? I prefer footer, because I wanted my site to load faster by reducing the number of scripts in the header, but can it work even if the script is in the footer? Google used to recommend putting it just before the </body> tag, because the original method they provided for loading ga.js was blocking. The newer async syntax, though, can safely be put in the head with minimal blockage

Simple NGINX log file analyzer [closed]

[亡魂溺海] 提交于 2019-12-02 14:16:39
I'm looking for a simple tool to analyze my NGINX logs on my macbook. I want to be able to get some basic stats including bot access and also be able to sort/filter the logs to find out what happened right before the server crashed. You may try with GoAccess ; free and open source console based. It may output an HTML report too. I've come across visitors . It's written in C and is pretty fast. It lacks goaccess' cool ncruses interface. It only outputs html. It does the job, though. Edit: It can also output human-readable text reports: visitors access.log | less I will suggest to use logstash

Facebook page insights via API

…衆ロ難τιáo~ 提交于 2019-12-02 08:57:12
I would like to access the insights of a Facebook page via the API. It is very well possible to obtain the insights of a Facebook app via the graph API, but I cannot find something similar for Facebook pages. Am I missing something? Specifically, I am looking for stats such as total users, active users, posts, etc, preferrably over time as well. Insights table docs say it is possible to retrieve metrics for all pages that are owned by currently logged in user after requesting read_insights extended permission. I think after that graph insights should work ( /<page_id>/insights?access_token=...

Detect whether a window is visible [duplicate]

给你一囗甜甜゛ 提交于 2019-12-02 04:55:49
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Javascript: Is there any way to detect that window is currently active? (i.e. is beening shown on active tab/window) I have a web-based dashboard which displays critical time-sensitive messages to nurses etc. on a hospital floor. The challenge is that if the dashboard is not open or is minimized, they will not see the message and be able to respond. I currently track percent of time that the app is running (it

Eliminate duplicates using Oracle LISTAGG function [duplicate]

半世苍凉 提交于 2019-12-02 04:39:51
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: LISTAGG in oracle to return distinct values I am using Oracle LISTAGG function but within my list of returned names I actually would like to eliminate duplicates and only return distinct values. The query I have is something like this: select a.id, a.change_id, LISTAGG(b.name, ',') WITHIN GROUP (ORDER BY b.name) AS "Product Name", from table_a a, table_b b where a.id = 1 and b.change_id = c.change_id group by a

Spotfire date difference using over function

六眼飞鱼酱① 提交于 2019-12-02 04:22:49
I have the following data set: Item || Date || Client ID || Date difference A || 12/12/2014 || 102 || A || 13/12/2014 || 102 || 1 B || 12/12/2014 || 141 || B || 17/12/2014 || 141 || 5 I would like to calculate the difference in years between the two dates when the client ID is the same. What expression can I use in a calculated column to get that value? UPDATE Hi This would be the intended values calculated. My table has approximately 300,000 records in no particular order. Would I have to sort the physical table before using this formula? I used this example from another I found, my actual

Overwriting 'Devise::RegistrationsController' with custom create gives NoMethodError

怎甘沉沦 提交于 2019-12-02 02:32:02
问题 Please let me know if I'm going about this the wrong way. I'm trying to add a couple custom attributes to a User in the create method as well as call my Analytics method if the user is saved. I defined a new controller: class RegistrationsController < Devise::RegistrationsController def create build_resource(sign_up_params) resource.public_id = Utilities::generate_code resource.referral_code = Utilities::generate_code if resource.save Analytics.identify( user_id: resource.id.to_s, traits: {

Overwriting 'Devise::RegistrationsController' with custom create gives NoMethodError

。_饼干妹妹 提交于 2019-12-02 01:41:42
Please let me know if I'm going about this the wrong way. I'm trying to add a couple custom attributes to a User in the create method as well as call my Analytics method if the user is saved. I defined a new controller: class RegistrationsController < Devise::RegistrationsController def create build_resource(sign_up_params) resource.public_id = Utilities::generate_code resource.referral_code = Utilities::generate_code if resource.save Analytics.identify( user_id: resource.id.to_s, traits: { email: resource.email }) yield resource if block_given? if resource.active_for_authentication? set_flash

Eliminate duplicates using Oracle LISTAGG function [duplicate]

帅比萌擦擦* 提交于 2019-12-02 00:58:45
Possible Duplicate: LISTAGG in oracle to return distinct values I am using Oracle LISTAGG function but within my list of returned names I actually would like to eliminate duplicates and only return distinct values. The query I have is something like this: select a.id, a.change_id, LISTAGG(b.name, ',') WITHIN GROUP (ORDER BY b.name) AS "Product Name", from table_a a, table_b b where a.id = 1 and b.change_id = c.change_id group by a.id, a.change_id At the moment, it is returning (just showing one record): 1 1 NameA, NameA, NameB, NameC, NameD, Name D What I would like returned is: 1 1 NameA,