How to get unread articles from the past hour using google reader api - google-reader

I m able to get 20 unread articles using this
http://www.google.com/reader/atom/user/[userid]/state/com.google/reading-list?n=20'
How do I get all unread articles within the past 1hour?

http://www.google.com/reader/atom/user/[userid]/state/com.google/reading-list?n=1000&ot=[current epoch time - 3600]&r=n&xt=user/-/state/com.google/read
&r=n desc order, &r=o asc order

Related

WooCommerce get total of additional fees added to cart

Depending on the cart total, I add an additional fee to each order
$cart_fee = 6.64;
if ($cart_total > 0)
WC()->cart->add_fee(__('Shipping Insurance', 'txtdomain'), $cart_fee);
Now I need to get a total of those fees by date range by either an SQL query or a piece of code that would print these values out on a custom page.
I'm posting this question while researching but I am hoping I can get some ideas before it costs me hours of time.
Below are the two DB tables and their connections for you to start with.
Using the order_item_id, query to the item_meta table for getting the values.

hits.page.searchKeyword doesn't match Total Unique Searches

I'm playing around with BigQuery google_analytics_sample data.
I'm trying to retrieve the number of Total Unique Searches I'm seeing from the Google Analytics UI.
I'm running the following query:
SELECT
hits.page.searchKeyword AS Search
FROM
`bigquery-public-data.google_analytics_sample.ga_sessions_*` AS GA,
UNNEST(GA.hits) AS hits
WHERE
(_TABLE_SUFFIX BETWEEN '20170101'
AND '20171231')
and hits.page.searchKeyword IS NOT NULL
and I got 441 when the UI show 607 Total Unique Searches.
What do I'm missing?
Thanks.
It looks like the linked table doesn't contain data for all dates in 2017.
SELECT
max(_TABLE_SUFFIX) as max_suffix
FROM
`bigquery-public-data.google_analytics_sample.ga_sessions_*` AS GA
WHERE
(_TABLE_SUFFIX BETWEEN '20170101'
AND '20171231')
Try adjusting your date filters in the GA report.

Not getting all events with session info

Does anybody know how to be sure that all the events get the 'ga_session_number' and 'ga_session_id' parameters with firebase?
Right now I'm getting only a 3% of the total events with those parameters and it should be on every event. Last sdk version is loaded on the app.
Thanks in advance for the help
The query I'm making is the following:
SELECT
user_pseudo_id, event.value.int_value session,
MIN(event_previous_timestamp), MAX(event_previous_timestamp),
MAX(event_timestamp) - MIN(event_timestamp),
COUNT(*)
FROM
`table`,
UNNEST(event_params) AS event
WHERE
event.key = 'ga_session_number'
GROUP BY
1, 2
ORDER BY
2
The total event rows on the table are more than 3 million, and getting only 100k with the query.
UPDATE:
Firebase support team has updated the analitycs SDK solving this issue.

Google Big Query page view count does not match with GA page view count

I am trying to get the count of total.pageviews of people go through the booking page on website. Here is my query.
SELECT sum( totals.pageviews ) AS Searches,Date
FROM `table*`
WHERE exists (
select 1 from unnest(hits) as hits
where hits.page.pagePath ='booking'
)
and date='20161109'
GROUP BY DATE
But I got way more results than what i got from Google Analytics.
Big query result: around 1M
GA: around 300,000
This is the GA page that I am trying to match with
GA result
After looking a bit more into Google Analytics data, I think that you actually want to count entries in hits that match the condition directly instead of relying on totals.pageViews. The problem is that totals.pageViews represents the number of distinct pages visited within a particular session (if I'm using the correct terminology), which includes pages that don't match your filter. I think you want something like this instead:
SELECT
COUNT(*) AS Searches,
Date
FROM `table*`, UNNEST(hits) AS hit
WHERE hit.page.pagePath = 'booking';
This counts the matched pages directly, and will hopefully give the expected numbers.
Try below
SELECT
date,
COUNT(*) AS Searches,
SUM(totals.pageviews) as PageViews
FROM `table*`, UNNEST(hits) AS hit
WHERE hit.page.pagePath = 'booking'
AND hit.hitNumber = 1
GROUP BY date
Searches - number of sessions started with booking page as an entry point to website;
PageViews - number of pageviews in those (above) sessions
I would like to have total(totals.pageview ) for the booking page on
the website. how many times that the booking page has been viewed
First - total(totals.pageview) - doesn't help in identifying what really you need as you are assuming that using total.pageviews field is correct, which seems is not - at least based on the rest of your wording
Secondly, if to assume that what you need is - count of pageviews of the booking page on the website - the only reasonable answer is below
SELECT
date,
COUNT(1) AS BookingPageViews
FROM `table*`, UNNEST(hits) AS hit
WHERE hit.page.pagePath = 'booking'
GROUP BY date
Finally, if you still getting numbers different from what you expect - you need to revisit your what actually you are looking for. It might be that the number that you see in GA represents metric that is different from what you think it represents. This is the only explanation I would see
I found the solution solve this problem:
SELECT count(totals.pageviews) AS Searches,Date
FROM table, UNNEST(hits) as hits
WHERE hits.page.pagePath ='/booking' and hits.type='PAGE'
GROUP BY DATE
Hope this answer can help other people.

Counting session from each page from the data exported to bigquery from google analytics

I have been trying to count the session for each page using bigquery where data is exported to bigquery from GA. The schema of the data can be found here.
I have tried following query
SELECT
hits.page.pagePath AS page,
COUNT(totals.visits) AS sessions
FROM
[xxxxxxx.ga_sessions_20160801]
WHERE
REGEXP_MATCH(hits.page.pagePath, r'(orderComplete|checkout)')
AND hits.type = 'PAGE'
GROUP BY
page
ORDER BY
sessions DESC
I compared the result of the query with numbers that I get from the GA but the result is quite different. I expected that above query would give total session for each page but it gives total pageviews for each page. In other words result of above query exactly match with pageviews of each page instead of sessions of each page.
I also tried the following query
SELECT
hits.page.pagePath AS page,
COUNT(hits.isEntrance) AS sessions
FROM
[xxxxxxx.ga_sessions_20160801]
WHERE
REGEXP_MATCH(hits.page.pagePath, r'(orderComplete|checkout)')
AND hits.type = 'PAGE'
GROUP BY
page
ORDER BY
sessions DESC
The result this time is very close to actual but not exactly the same as numbers that I am getting from GA. This time bigquery result is slightly less than that of the GA for some pages.
There is no sampling in GA in my case otherwise result is acceptable because error is between 0.5% to 4%
I am working with raw data without any filter on GA profile and same data is exported to bigquery.
Question: How is session counted when we count session by pages?
When I don't group the result by hits.page.pagePath there is no mismatch of results that I get from GA and that from bigquery
Instead of using COUNT(totals.visits), what if you use COUNT(1)? The results of COUNT will vary depending on whether you are using a repeated field. Possibly relevant question with some in depth answers: BigQuery flattens when using field with same name as repeated field
As an aside, standard SQL (uncheck "Use Legacy SQL" under "Show Options") has less surprising semantics around counting, although it would require you to be more explicit with operations on arrays in this case.
To count sessions, I use COUNT(visitId) instead of COUNT(totals.visits). This seems to give me numbers identical--or very, very close--to what I see in GA.

Resources