YouTube Videos on a Magento 2 Product Page – How to get a YouTube API Key

Encouraging visitors on your eCommerce store to engage with your products, while converting this enthusiasm into a sale is vital. There are many ways of achieving this, through informative copy and attractive imagery. One aspect that often is overlooked though is the power of video.

Videos may demonstrate the features of a product, how to guides on best uses or instructional demonstrations of installation. They provide confidence, while also providing a total audio and visual experience that can be your best engagement tool.

Embed YouTube videos on Magento 2

So how do you add a YouTube video to Magento 2… Let us show you how.

1 - Obtain a YouTube API key

The very first step is to get yourself a YouTube API key, which will give Magento the access it needs to access the data from YouTube to populate the video information and embed it within your product page.

  • Visit the Google API Library
  • Select ‘YouTube Data API v3’
  • Select ‘Enable’
  • Select ‘Create Credentials’ > ‘API Key’
  • Copy the text which displays your unique API key

2 - Adding your YouTube API key in Magento 2

Now let’s head back to your Magento store to enter the YouTube API key:

  • On the sidebar of Magento go to Stores > Settings > Configuration
  • Under ‘Catalog’ select ‘Catalog’
  • Under the ‘Product Videos’ area, paste your previously copied YouTube API key into the required field
  • Save

3 - Adding a YouTube video to a Magento 2 product page

Now to tell Magento to insert the video on to a Product page…

  • Visit the product page edit view you wish to add the video to
  • Go to the ‘Images and Videos’ section
  • Click ‘Add Video’
  • Enter the URL of the video you wish to embed
  • Click the ‘Get Video information’ button to fill in a lot of the details and customise as required
  • Save your product

All that is left is to check the frontend of the website to ensure your video has appeared.

Remember to clear your cache under ‘Cache Management’ for good measure if you find the video is not yet visible.

Embed YouTube videos on Magento 2

We are a Magento development agency with 20 years eCommerce experience; for any help or advice on migrating, updating or maintaining your Magento eCommerce site, contact our team today.

Get eCommerce insights straight to your inbox each month

See an example of what we send out each month

magic42 serves online retailers throughout the UK, delivering first class Magento Development and also as a Shopify partner – we power retail success. 

Get eCommerce insights to your inbox

Sign up for our monthly newsletter.

Expert Magento Developers

We’ll get your systems talking to each other and Magento & Magento 2 neatly integrated into your wider business. From advice on the best Magento & Magento 2 extensions to migrating your data or bespoke development, we’ll work with you to find the best solution for your unique business.

Powered by Retail Success

magic42 is unique in that it evolved from Mobile Fun, an award winning online retailer with 17 years’ experience, 27 international websites and a global distribution network managed from the heart of Birmingham.