analytix icon indicating copy to clipboard operation
analytix copied to clipboard

Add a trouble-shooting guide

Open parafoxia opened this issue 2 years ago • 4 comments

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 avatar Feb 19 '23 13:02 parafoxia

@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

dendihandian avatar Sep 09 '24 10:09 dendihandian

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 avatar Sep 09 '24 10:09 parafoxia

@parafoxia can analytix select other channel managed by the used account (secrets.json)?

dendihandian avatar Sep 10 '24 04:09 dendihandian

Yes -- you'll need to reauthorise and select the channel you wish to get data for in the auth flow.

parafoxia avatar Sep 10 '24 08:09 parafoxia