Python and Google Analytics 4 Tutorial | Most Popular Posts

preview_player
Показать описание
In this video, we'll imagine a mock scenario where the Developer team needs you to query Google Analytics to get the most popular posts from the past 24 hours, using Python, and writing that data to a JSON file, where the dev team can then apply it to the website's trending posts.

We'll learn
- How to set up a Google project and correct permissions to access the Google Analytics Data API
- How to interact with the Google Analytics 4 API with Python
- How to effectively read documentation
- How to retrieve the 5 most popular posts from Google Analytics using Python
- How to write this data to a file

I'll prompt you with opportunities to write the code and find the solution, yourself.

Timestamps
00:00 Intro
00:30 The scenario
01:14 Visual example and explanation
02:08 Set up Python environment
03:16 Google Analytics API documentation
03:42 Enable the API
05:36 Add service account to property
06:57 Configure authentication
07:48 Install client library
08:21 Make API call
09:59 Writing Python script
13:55 Your turn - pseudocode
16:02 My solution
18:33 Write data to file
20:18 Want to see the automation?

** Career Path Coding Tracks **

** My Coding Blueprints **

** I write regularly **

** FREE EBOOKS **

LET'S CONNECT!

#googleanalytics4 #pythonprogramming #devops

** Some of the links in this description may be affiliate links that I may get a little cut of. Thank you.
Рекомендации по теме
Комментарии
Автор

Travis, because of you i am hesding on full speed to become a better
Software engineer, thank you for all you do.

i--vik
Автор

Also! Would love to see the automation part!! I'm working in a personal project and the automation part would help a lot! Sadly there's not much content using Python and Google Analytics up to date!

carlosallan
Автор

Looking forward to the automation segment.
Cheers.

jayjay
Автор

Gotta say, that was the best video about it that i found. All the others the code didn't worked and or i had a problem, in this one i also had a problem, i needed to run it in Asyncio, but it was easy to fix! Great video, keep it up!

carlosallan
Автор

I really liked your video! Thanks a lot for explaining everything so clearly. I did exactly what you showed in the video, and it worked perfectly for me. When you talked about automating the process at the end, I got interested. It would be awesome if you could make a video on that too. Thanks again!

RamC-recd
Автор

The only tutorial that helps me. Thank you so much.

HarisKhan-phjl
Автор

Thanks for the video Travis. It was really helpful.

anuroopmallick
Автор

Hello. Thank you for great explanation with live examples, subscribed and liked))

SerhiiYashchuk
Автор

Insightful video, looking forward to seeing more 😄

mariumbegum
Автор

at 9:45 how come you got demo data under your property? I've tried getting data from the demo, but I can't see to get any data returns? it returns empty also adding my own service email under demo account is not accessible

adigaknocker
Автор

Is there a way to download the raw data from GA4 using python? I mean the GA4 raw data that are not aggregated by metrics and dimensions.

ccc_ccc
Автор

Hey @Travis Media I really appreciated your AWS amd python videos a lot!!!.I am curious to know whether that series was still on-going?

maxwiili
Автор

Why you don't need to 'enable billing' on the 'install client library' steps? it seems to work without enabling billing which is contradictive with the current docs lol. Do you possibly know the reason and could assist me?

seve-fnmo
Автор

Hi Travis, thank you very much for the video. I have a bit problem with retrieving data from GA4. I added the error script to troubleshoot and found out Python is giving the error message "File service_account.json is not a valid json file.', JSONDecodeError('Expecting value: line 1 cloumn 1 (char 0)')". Do you have any idea how's this happened?

henrychoi
Автор

Sir GA4 requires 24 hours to mature oresle thr not set will be seen more will this python extraction method will solve this issue

kannadastocktrader
Автор

Hello sir ! I am 2 year btech student should i go for cloud & Devops in terms of job in India ??

Divu
Автор

i need this on realtime, but pagepath or fullurlpage is not a dimension valid

GregoryGustavo