how to fetch ecommerce data from google analytics - google-analytics

I need to fetch ecommerce data from google analytic for custom reporting using a php application. I need to fetch data like last 5 sales, total sales by date, by month etc. But, I am not getting any clue how to get data from analytic. Please give me a clue... Thanks in advance

Related

Google Analytics purchase event - track time with date

Does the time get stored with the date OOTB with the Google Analytics 4 (GA4) on eCommerce events?
On my company’s implementation when I look at the data stored to e-commerce events, like the purchase dimension, everything is showing as occurring at 12am. Do you know why this is? Is it a config issue or the way I am connecting?
I’ve seen posts where people create JavaScript variables to track time in GA4 and save to a dimension but this makes no sense given the high cardinality of time. I would have thought it would be more efficient to store as a datetime data type and track as part of the GA4 application.
Does anyone here see the time an event occurred on GA4 eCommerce events?

Get data for specific URL by day and time in Google Analytics

Is it possible to get a breakdown reporting in Google Analytics for the number of sessions/users during day and time on a specific URL? I was looking at some custom reporting and going down the route of using a pivot table, but I'm not sure if that's overkill for something that can be done directly in GA outright.
You can use custom report with page and hour of day as dimensions and sessions as metric.

How to fetch DFP Clicks and Impressions data from Google Analytics

I am working on Google Analytics to fetch following data from query-explorer
I want following data for current Month:
userID = saved in dimension ga:customVarValue2
Timestamp = I took dimension ga:dateHourMinute
url = I took ga:hostname and ga:pagePath
I want only two metrics related to DFP clicks and impressions
Since there are no any DFP dimensions,so I entered only impressions and clicks here and it shows me query error (Please see the screenshot)
Can Anybody please explain me how to get data related to DFP clicks and impressions here.
Thanks in Advance
DFP Reporting needs to be set up before you can query on it. There are certain requirements you have to meet in order to be able to make the reports.
https://support.google.com/analytics/answer/6183304

analytics api - Google sheets

I have set up the Google analytics API on Google sheets for reporting purposes, however have had some issues in capturing transaction and revenue data, when filtering.
The API pulls in revenue and transaction data fine for me when not filtering, however I've used the below filter, because this is how our website splits out our white labels, with each white label having a different affiliate id.
ga:pagePath=#/?affiliate_id=default
This pulls through the filtered session data through fine, but does not pull through transaction or revenue data.
When using Google Analytics rather than the GA API in Google sheets, the same filter works fine, and shows the transaction and Revenue data. However through the API in Google Sheets the above filter shows the transactions and revenue as 0.
Does anybody know what I've done wrong here, and what the correct code would be to enter in the filter box in Google sheets so I can pull in the transaction and revenue data?
My technical knowledge is very limited here so appreciate the help.
Many thanks!
Rob
You may want to try the queries given in Core Reporting API - Common Queries.
Like, for Revenue Generating Campaigns, to get campaign and site usage data for campaigns that led to more than one purchase through your site, you may use this query:
dimensions=ga:source,ga:medium
metrics=ga:sessions,ga:pageviews,ga:sessionDuration,ga:bounces
segment=dynamic::ga:transactions>1
And to get information on revenue generated through the site for the given time span, sorted by sessions in descending order, you may use the sample query in All Traffic Sources - E-Commerce:
dimensions=ga:source,ga:medium
metrics=ga:sessions,ga:transactionRevenue,ga:transactions,ga:uniquePurchases
sort=-ga:sessions
I also suggest that you try and explore using Query Explorer.

Google Analytics monthly report to be sent weekly?

It is possible to choose an interval for a certain Google Analytics report?
I would like to be able to send a monthly report (for the last 30 days) on weekly basis.
I don't believe this is currently possible through the Google Analytics website, but you could use the Google Analytics Spreadsheet Add-on to achieve a very similar result.
You can Share almost any report in GA
Use Email option and set frequency Weekly.
I am new here so cant post image, would have posted screenshot otherwise.

Resources