Blog / Integrations
Here is a step-by-step guide to fetching YouTube metrics and adding them to google sheets every day or every month. Also, get a notification while we're at it.
We use a variety of services today to support multiple use cases and so, it becomes increasingly important to be able to connect to different integrations.
Here is a step-by-step guide to fetching YouTube metrics and adding them to google sheets every day or every month. Also, get a notification while we're at it :P
Step 1: Creating necessary sheets to hold our statistics
So the first step is to create two different empty set of google sheets to hold our every day and every month statistics. We're looking to create two sets of sheets like this:
Step 2: Let's start working on those integrations!!
Go to this sample project and click on the top right corner to clone it. This project already has youtube integration for metrics set up. So we can simply clone it and get started.
Step 3: Explore API tab
From the left-hand navigation bar, move to the API tab. In the left-hand panel, you'll find different divisions like - Endpoints, Scheduled triggers, DB triggers, Integration triggers, etc. In the scheduled triggers, you should find two triggers already set up.
Step 4: The dailyReporting flow
Click on the dailyReporting trigger and it'll open up the graph for it. Our flow looks something like this:
Clicking on these individual pills will reveal their settings and configurations.
NOTE: You may need to re-authenticate yourself on each plugin as you've cloned the project.
Step 5: Updating configuration of integrations
Let's start inspecting and correcting any integration settings should we have to. Click on the left-most trigger will reveal its settings.
As you can check we've set it up to execute every day around 12:17 AM. You can change this schedule should you want to by clicking on the trigger.
Similarly, Youtube integration also has different settings that you can configure. Please move to the auth tab to re-authenticate in case it's required. In the optional parameters, you can define the different variables through which you want to query youtube. In this instance we're using these query parameters:
Very similarly to how the above settings were configured, we can similarly click on the google sheets to configure its settings.
A1:B30
valueInputOption
to RAW
{{1.rows.[0].[0]}
- here 1 refers to 1st webhook in the chain that is Youtube, and the array [0][0] represents the first value returned by the youtube webhook.Finally, we move to slack and update its minimal configuration to trigger a message whenever this workflow is executed. It'll look like this:
and Voila! We have our entire chain set up where
Step 6: Creating the flow for monthly Reporting
Similar to how we've created the flow for daily reporting, we'll create on for monthly reporting, where most of the queries will be similar.
We just have to change youtube query parameters, like this
and change google sheet values like this π
With these minor changes, we can modify our trigger to post youtube metrics to google sheet monthly. All of the above-mentioned query parameters can be found in the documentation for google sheets and youtube.
Hope this guide turns out to be a good help for you guys. You can clone the sample project directly from here.
You can also check out our other guides here.
Join us on discord to discuss or share with our community. Write to us for any support requests at support@canonic.dev.
Start using canonic's fullstack solution to build internal tools for free