Table of Contents
The purpose behind it is to satisfy customers by providing them with a more detailed product description. Videos on a product page is a great way to share details and making the product page more attractive. Not only that, you can also use your product video for promotional activities.
You can easily add Magento 2 product videos which can help inform your customers about your products in a better way.
Steps for Adding Magento 2 Product Video
- Generate a Youtube API Key
- Integration of the Youtube API key into Magento 2
- Implementation of Magento 2 Product Video
Generate a YouTube API Key
To add product video, you must first obtain an API Key from your Google account and enter it in the configuration of your store. Then, you can link to the video from the product.
Here are the steps for this-
- Log in to your Google account and visit the Google Developers Console.
- In the Search field at the top, enter
YouTube Data API v3
and click the search icon and click onYouTube Data API v3
.
- When the API page is displayed, make sure it is enabled.
- In the left panel, choose Credentials.
- Depending on whether you have credentials or not, do one of the following:
- If you already have the needed credentials, copy the key in the API keys table.
- If you do not already have credentials for this API, click Create Credentials at the top and follow the prompts to create the needed credentials. Under Get your credentials, copy the API key and click Done.
- Copy the API key to the clipboard.
- Click the Edit icon on the right and set the restrictions to make sure the API key is limited to the correct referrers.
- Wait a few moments while the key is generated and then copy the key to the clipboard.In the next step, you will paste the key into your store’s configuration.
Integration of Youtube API key to Magento 2
Go to the Admin Panel of your Magento Store and navigate to the STORES tab from the left corner of the page. Select Configuration from the options.
Now click on Catalog under CATALOG:
Go to Product Video section and insert the Youtube API key which you generated in Google Developers Console. Then click on Save Config.
Configure product video options
You can set the following product video options:
OPTION | DESCRIPTION | TYPE | DEFAULT |
---|---|---|---|
play_if_base |
Play automatically on page load. | Boolean | 0 (video is not played on page load) |
show_related |
Display related videos. | Boolean | 0 (related videos are not displayed) |
video_auto_restart |
Auto re-play video. | Boolean | 0 (video is not automatically replayed) |
Integrate Magento 2 Product Video
Go to the Admin Panel of the Magento 2 Store and navigate to the CATALOG tab. Next, click the Products option.
Click on the Edit option of product.
Now go to the Images and Videos section of Product and click on Add Video.
Enter the Product video URL from Youtube and click on Save.
Now, just click on Save THE PRODUCT.
To watch this video, open this product on the frontend.
The above result means that you have successfully integrated a Magento 2 product video.
Conclusion
You can use the video feature to attract and convince customers about the product. By following this tutorial, you’ll be able to add Magento 2 product videos easily. If you have a problem or would like to add more to the discussion, just leave a comment below.