Python and Google Analytics 4 Tutorial | Most Popular Posts
Вставка
- Опубліковано 6 чер 2024
- 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 **
Web Developer - geni.us/jBigBd
Software Engineer - geni.us/AbMxjrX
Machine Learning - geni.us/GporLlT
Python Developer - geni.us/tv2FJBU
DevOps Engineer - geni.us/MgHtJ
** My Coding Blueprints **
Learn to Code Web Developer Blueprint - geni.us/HoswN2
AWS/Python Blueprint - geni.us/yGlFaRe
** I write regularly **
travis.media
** FREE EBOOKS **
📘 travis.media/ebooks
LET'S CONNECT!
📰 LinkedIn ➔ / travisdot. .
🐦 Twitter ➔ / travisdotmedia
🙋🏼♂️ Website ➔ travis.media
#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.
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!
Insightful video, looking forward to seeing more 😄
The only tutorial that helps me. Thank you so much.
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!
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!
Hello. Thank you for great explanation with live examples, subscribed and liked))
Looking forward to the automation segment.
Cheers.
thanks
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?
Yes, I’m planning more, thanks for asking. Anything particular you’d like to see?
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?
Hello sir ! I am 2 year btech student should i go for cloud & Devops in terms of job in India ??
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?
Sir GA4 requires 24 hours to mature oresle thr not set will be seen more will this python extraction method will solve this issue
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.
i need this on realtime, but pagepath or fullurlpage is not a dimension valid
Can you please assist to get this data in real time to Kafka topic
Automation is required