analytix
analytix copied to clipboard
Add a trouble-shooting guide
Summary
Add a page in the documentation covering the most common issues and ways to fix them.
Why?
The API is complicated, and analytix can only do so much to make the experience easier, and even then it can be a little difficult to get used to, especially when the causes of issues are unclear.
Ideal implementation
A guide in the documentation.
Additional information
No response
Contribution
- [X] I wish to contribute this feature.
Checklist
- [X] I have searched the issue tracker for duplicate issues and couldn't find any. If this is a follow-up issue, I have specified as such.
@parafoxia hello Ethan, can we use more than one dimension? I tried to use day and video for the dimensions like the following:
from datetime import date, datetime
from analytix import Client
client = Client("secrets.json")
report = client.fetch_report(
dimensions=("day","video",),
# filters={"country": "US"},
metrics=("estimatedMinutesWatched", "views", "likes", "comments"),
# sort_options=("-estimatedMinutesWatched",),
start_date=date(2020, 1, 1),
end_date=date(2024, 9, 9),
max_results=10,
)
now = datetime.now().strftime("%Y%m%d%H%M%S")
report.to_csv(f"{now}_analytics.csv")
but I got this error:
analytix.errors.InvalidRequest: dimensions 'day' and 'video' cannot be used together
Hi @dendihandian, you can yes, but not in all situations. The YouTube Analytics API doesn't support adding extra dimensions where "video" is used. For example, "day" and "subscribedStatus" could be used together, but not "day" and "video".
There are other instances of this, but they're not explicitly documented within analytix as YouTube's documentation goes into detail. analytix will catch anything invalid though, so you could alternatively just throw stuff at it and see if it works.
@parafoxia can analytix select other channel managed by the used account (secrets.json)?
Yes -- you'll need to reauthorise and select the channel you wish to get data for in the auth flow.