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.
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
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.