YouTube
Included with Macro DeckShow your YouTube live chat and stream stats, change title and tags, and react to Super Chats and members.
A YouTube Chat widget and YouTube Stream Stats widgets
- YouTube Chat and YouTube Stream Stats widgets
- Set the stream title, description and tags
- Go live, end the stream and start ad breaks
- Triggers for Super Chats, Super Stickers and memberships
- Uses your own Google Cloud project and quota
The YouTube integration connects your YouTube channel to Macro Deck. It shows the state of your live stream as variables, fires triggers for Super Chats, Super Stickers and memberships, shows your live chat in a widget where you can moderate it, and changes your broadcast from a button.
YouTube does not offer a shared login that Macro Deck could use for everyone. You connect through a Google Cloud project of your own, which takes about ten minutes once. The project is free, and its quota and permissions belong to you alone.
What you can do
- Send a chat message to the live chat of your current broadcast.
- Change the title, description or tags of the broadcast that is live, or of the next scheduled one when you are not live.
- Start the next scheduled broadcast with Go Live, end it with End Stream, and ask YouTube for an ad break.
- Show the live chat in the YouTube Chat widget, and delete messages, time out or ban chatters from it.
- Show whether you are live, your viewers, likes and subscribers, title and uptime in the YouTube Stream Stats widget.
Some example setups:
- A Going live button that sets the title and tags of your next broadcast.
- An Ad break button that asks YouTube for a 60 second ad break.
- A flow that runs on Super Chat and shows a notification with the author and the amount.
- A flow that runs on New Member and posts a thank-you message in the chat.
How it behaves
Macro Deck reads your stream state about once a minute and the chat every few seconds while you are live. Every read and every change costs quota from your Google Cloud project, which gets 10,000 units a day. Macro Deck keeps count. When the quota is almost used up, it pauses chat updates and reads the live status less often. When the quota is used up, it pauses live status and chat updates until midnight Pacific Time, when Google resets the quota.
Chat, Super Chats and membership events only arrive while a broadcast is live. Events that happened while Macro Deck was not running are not fired later. You can connect more than one channel: every action has a Channel field, and every trigger can be limited to one channel.
What you need
- Macro Deck 3 on Windows, macOS or Linux, with internet access
- A YouTube channel that can stream live
- A Google Cloud project with the YouTube Data API v3 enabled
- An OAuth client ID of the type TVs and Limited Input devices, with its client secret
- Start Ad Break needs a live broadcast on a channel that can show mid-roll ads
Set it up
Step 1: Create a Google Cloud project
Open the Google Cloud console with the Google account that owns your channel and create a project, for example Macro Deck. Under APIs & Services > Library, search for YouTube Data API v3 and click Enable.
Step 2: Set up the consent screen
Open APIs & Services > OAuth consent screen (in newer consoles Google Auth Platform). Choose External, enter an app name and your email address, and save. Under Audience (or Test users), add the Google account that owns your channel as a test user.
Step 3: Create an OAuth client ID
Open APIs & Services > Credentials, click Create credentials > OAuth client ID and choose the application type TVs and Limited Input devices. Any other type is refused when you sign in. Copy the Client ID and the Client secret that Google shows.
Step 4: Enter the client in Macro Deck
In Macro Deck, click Integrations in the sidebar and click YouTube. On the Overview tab, click Add configuration in the Configuration section. Turning on the switch at the top right opens the same dialog, and the integration is turned on once the setup is done. In the dialog Connect a YouTube channel, paste the Client ID and the Client secret. Only if Google granted your project more quota, turn on Advanced configuration and enter it as Daily quota (units). Click Continue.
Step 5: Approve the access on Google
The dialog now shows Approve access on Google with a Device code. Click Open Google and approve, sign in with the account that owns your channel, enter the code, choose your channel and allow access. Google warns that the app is not verified: it is your own project, so continue. Come back to Macro Deck and click Continue. The configuration is named after your channel, for example YouTube (My Channel). When the dialog shows Setup complete., click Done.
Step 6: Add a YouTube action to a button
On the Deck page, click the button you want to use. The deck must be unlocked: when the button at the top right reads Lock, it is unlocked. The editor opens with Short Press selected. Click + Add action, select YouTube on the left of the Add action dialog and pick an action such as Set Stream Title. Choose the Channel, enter the Title, then click Save.
Actions7
Put these on a button or run them from a flow.
- Send Chat Message
- Posts a message of up to 200 characters in the live chat of your current broadcast.
- Set Stream Title
- Changes the title of your current broadcast, or of the next scheduled one when you are not live.
- Set Stream Description
- Changes the description of your current broadcast, or of the next scheduled one.
- Set Stream Tags
- Replaces the tags of your current broadcast, or of the next scheduled one.
- Start Ad Break
- Asks YouTube to show an ad break of 30 seconds to 3 minutes during your live broadcast.
- Go Live
- Starts the next scheduled broadcast that is ready. Start your streaming software first.
- End Stream
- Ends your current live broadcast.
Triggers8
A button or flow can react to these events.
- Stream Online
- The channel went live.
- Stream Offline
- The channel's live broadcast ended.
- Super Chat
- Someone sent a Super Chat, with the author, amount, currency and comment.
- Super Sticker
- Someone sent a Super Sticker.
- New Member
- Someone became a member of the channel or upgraded their membership.
- Member Milestone
- A member shared a membership milestone in the chat.
- Gifted Memberships
- Someone gifted memberships to other viewers.
- YouTube Event (Advanced)
- Every YouTube event in this list in one trigger, optionally filtered by type.
Variables8
Show these values on buttons and widgets, or use them in conditions.
youtube_<channel>_display_name- The name of the channel.
youtube_<channel>_is_live- Whether the channel is live.
youtube_<channel>_stream_title- The title of the live broadcast.
youtube_<channel>_viewer_count- Current viewers. Empty when you hide the viewer count.
youtube_<channel>_like_count- Likes of the live broadcast.
youtube_<channel>_subscriber_count- Channel subscribers as YouTube rounds them.
youtube_<channel>_uptime_seconds- How long the broadcast runs, in seconds.
youtube_<channel>_stream_thumbnail_url- The thumbnail of the broadcast.
Widgets2
Add these to your deck from the widget picker.
- YouTube Chat
- Shows the live chat of your current broadcast, including Super Chats and new members. Press it to moderate in a larger dialog.
- YouTube Stream Stats
- Shows your live status, viewers, likes and subscribers, title and uptime, in a style you choose.
Frequently asked questions
Why do I need my own Google Cloud project?
YouTube does not offer a shared login that Macro Deck could use for everyone. With your own project, the quota and the permissions belong to you alone. The project is free.
Why do I have to sign in again every week?
While your project's consent screen is in testing, Google ends the sign-in after 7 days. Integrations then shows that the sign-in expired; reconnect with the same client ID and client secret. To stay signed in, publish the consent screen in the Google Cloud console.
What happens when the quota runs out?
Macro Deck pauses live status and chat updates, and the YouTube page under Integrations shows YouTube quota used up. Google resets the quota at midnight Pacific Time, and updates resume then. Actions keep working until Google refuses them.
Why does Go Live not start my stream?
Go Live starts the next scheduled broadcast whose stream already arrives at YouTube, so start your streaming software first. Broadcasts that start by themselves, and Stream now in YouTube Studio, are started by YouTube and not by this action.
Can I unban someone from the chat widget?
Only bans you made through Macro Deck during the current broadcast, until Macro Deck restarts. YouTube does not tell Macro Deck which bans exist, so lift other bans in YouTube Studio.
Where are my credentials stored?
The client secret and the tokens are stored encrypted on the computer that runs Macro Deck and are only sent to Google.
More in Streaming
OBS Studio
Included with Macro DeckSwitch scenes, control your stream, recording and audio, and react to what happens in OBS Studio.
Meld Studio
Included with Macro DeckSwitch and stage scenes, control layers, effects and audio tracks, and go live in Meld Studio.
Streamlabs Desktop
Included with Macro DeckSwitch scenes, control your stream, recording and audio sources in Streamlabs Desktop.
Streamer.bot
Included with Macro DeckRun Streamer.bot actions, send chat messages and react to every event Streamer.bot reports.
Twitch
Included with Macro DeckShow your Twitch chat and stream stats, moderate, run polls and ads, and react to follows, subs and raids.