How to Setup YouTube Videos in Magento 2
In this tutorial you’re going to learn how to get your own YouTube videos onto your website.
Step 1. Find the Configuration Section for YouTube Videos
– Go to the Products menu on the left-hand side of your Magento dashboard then click on Catalog.
– Click on the product that you’re going to set up YouTube videos for, scroll down to the section of images and videos, and then click on Add Video.
– Underneath the Url box, right-click on the link that tells you to enter your YouTube API Key, and then select Open in New Tab.
– That opens up the configuration section which has a field assigned for the YouTube API Key.
Step 2. Get the YouTube API Key
– To get hold of the YouTube API Key, type console.developers.google.com/project in a new browser tab and then press enter on your keyboard.
– That takes you to the Google Developers site. Click on Select a project in the top right-hand corner followed by Create a Project.
– Type your domain name plus YouTube API Key (e.g. UnderstandingE YouTube API Key) in the Project Name box then click on Create.
– You should see your project name in the top right-hand corner where it used to say Select a project; if not, click on the down button then select the right project name.
– Assuming you’ve got the right project name, click on YouTube Data API underneath the YouTube APIs.
– Click on Enable at the top left to enable the YouTube API.
A pop-up message tells you that you need to create credentials before you can use the API, so click on Go to Credentials.
– Since the first option has already been preset to YouTube Data API v3, go to the next and choose Web server (e.g. node.js, Tomcat).
– Next, select Public data and then click on What credentials do I need?
– Leave Server key 1 in the Name field and then enter your IP addresses in the next box if you want to. Otherwise, proceed to click on Create API key.
– Highlight the API Key in the box, right-click and choose Copy from the pop-up menu, and then click on Done.
Step 3. Paste the YouTube API Key in Magento
– Go back to the YouTube configuration section in your Magento system, right-click on the YouTube API Key field, and then choose Paste from the pop-up menu.
– Once you have done that, press Save Config in the top right-hand corner.
– Grab the whole URL of your YouTube video then go back to your Magento system and reload the product page.
– Scroll down and click on Add Video, paste the URL of your YouTube video in the Url box, and then watch Magento prefill the Title, Description and Image fields with the info on your video.
– Press Save in the top right-hand corner and then click on Images and Videos on the left.
Step 4. View the Video on Your Website
– On your website, go to the category where your product is, then click on it.
– When a customer lands on this product page, the first thing they will see is the base image.
– As they move on to the next image, your YouTube video pops out, and it’s highly likely that they’re staying on this page for the next couple of minutes or so.
If you need a hand at any time, use the contact details below and the forums here are always open.
See you there,
Matt & Dave
See more here