NewAnnouncing EmbedSocial MCP: connect your data to any AI tool
View as Markdown

JavaScript Frameworks

Steps on how you can embed the EmbedSocial Widget Code in a React Application.

In this tutorial, I will give you a detailed walkthrough on how to embed your widget in a React Application.

1\. The first step is to copy the code from your created widget:

2.After the code is copied you will need to separate the HTML code from the JavaScript, for example:

This is the EmbedSocial widget code: <div class="embedsocial-hashtag" data-ref="f718fc77f3f7142d374023362f2fd1f2aa471605"></div> <script> (function(d, s, id) { var js; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://embedsocial.com/cdn/ht.js"; d.getElementsByTagName("head")[0].appendChild(js); }(document, "script", "EmbedSocialHashtagScript")); </script> HTML code: <div class="embedsocial-hashtag" data-ref="f718fc77f3f7142d374023362f2fd1f2aa471605"></div> JavaScript code: (function(d, s, id) { var js; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://embedsocial.com/cdn/ht.js"; d.getElementsByTagName("head")[0].appendChild(js); }(document, "script", "EmbedSocialHashtagScript"));

3\. Next head over to your React application and create a new component in your components directory and paste the HTML code inside the render function:

Paste the JavaScript code inside the componentDidMount lifecycle method:

4\. Navigate to the page where you want to display the widget, in our case we will add it to the main App.js, and import the component we just created:

5\. That's it. Once you do this and save the changes, the widget will appear on your page.

If you have any questions, click the bottom right chat icon to talk with our customer success team or send us an email at support@embedsocial.com We're here for you 🙏

Embed the widget in React

Thank you for posting this question! To answer it, of course, our widgets can be embedded in the React App as well.

Here is a helpful article on how to embed the widget on React App:

How to Embed Code in a React Application
If you have any questions, click the bottom right chat icon to talk with our customer success team or send us an email at support@embedsocial.com We're here for you 🙏

Embed in Vue

In Vue applications, there are two options when embedding custom HTML/javascript code:

  • Composition API
  • Options API

First, you will need to copy your widget code:

Copying the code

After you have copied the code, you will need to separate the HTML from the javascript, for example:

EmbedSocial widget code:
<div class="embedsocial-hashtag" data-ref="a4f74f50d0016f41895f78a3141a52b07c6933aa"></div>

<script>

(function(d, s, id) { var js; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://embedsocial.com/cdn/ht.js"; d.getElementsByTagName("head")[0].appendChild(js); }(document, "script", "EmbedSocialHashtagScript"));

</script>

HTML
<div class="embedsocial-hashtag" data-ref="a4f74f50d0016f41895f78a3141a52b07c6933aa"></div>
JavaScript
(function(d, s, id) { var js; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://embedsocial.com/cdn/ht.js"; d.getElementsByTagName("head")[0].appendChild(js); }(document, "script", "EmbedSocialHashtagScript"));
1\. Embedding the widget through the Options API

To embed the EmbedSocial widget code in a Vue application that uses the Options API, please follow the steps below:

First, head over to your Vue application and create a new component in your components directory:

Paste the EmbedSocial widget HTML code inside the <template> tags:

Paste the EmbedSocial widget javascript code inside the created lifecycle hook:

Now after you’ve created the EmbedSocial widget component, you just need to import the component and display it on your website.

Open the file/page where you want to display the widget and import the component, in this case, we are importing it in App.vue:

Here are the results from this code and using Options API

2\. Composition API

The Composition API is an addition to the Vue framework created to address the limitations of the Options API used in Vue2.

In order to embed your widget code in a Vue application that uses the Composition API, you will need to follow the steps below:

First, head over to your Vue application and create a new component in your components directory:

Next, paste the EmbedSocial widget HTML code inside the <template> tags:

Then you will need to import onCreated function from Vue, and paste the EmbedSocial widget javascript code inside the onCreated function:

By following the steps above, you’ve created the EmbedSocial widget component, we have to import the component and display it on your website.

Open the file/page where you want to display your widget and import the component, in this case, we are importing it in App.vue:

Once this is done, your widget will be displayed on your website.

That's it.

If you have any questions, click the bottom right chat icon to talk with our customer success team or send us an email at support@embedsocial.com We're here for you 🙏

Embed in Angular

In Angular applications, there are two options for integrating custom JavaScript code.

One option is to embed the code directly into the HTML, and the other best solution is to create a Component.

  1. # Embedding code anywhere on the page

This is a familiar option and the easiest way to go. So you can just access the html on any of your Angular files and paste the EmbedSocial code directly.

Here's an example:

2\. Creating a Component

There are two steps you need to follow to achieve this:

  • Create the component
  • Use the component

1\. In the terminal, use the following command \ng generate component EmbedSocialWidget\ to create an angular component called \EmbedSocialWidget\

2\. After the component is created, open \EmbedSocialWidget.component.ts\ and add an \@Input() decorated\ string called \refId\ just above the constructor.

3\. In that same file, inside the \ngOnInit()\ function, add the embedsocial javascript, which is responsible for building the widget.

Your component file \EmbedSocialWidget.component.ts\ should look like the image below:

Using the component

First, login to your EmbedSocial account and go to Widgets. Open one of the widgets that you want to embed and get the EmbedSocial data-ref attribute value (as mentioned above).

The data-ref attribute should look like this:

data-ref="1ca3d4d1a06e6fc2ae3b6b90f934326fd3a9edf4"

Once you have the data-ref, you can use the newly created \EmbedSocialWidget\ component freely anywhere within your angular project. Just edit the component’s \refId\ binding with the refId you copied from EmbedSocial before.

Here is an example of using the component:

That's it.

Hope this was helpful, and if you have questions or need assistance feel free to reach out to: ​ support@embedsocial.com

More in Integrations

App Store: Pin and Prioritize Reviews

Steps on how to pin and prioritise your reviews in your EmbedReviews app

App Store: Facebook and Google Reviews

Learn on how to embed the reviews widget in your responsive website builder with Google reviews or Facebook reviews

App Store: Reviews Widget

In this article I will show you how to embed your reviews widget in Duda website builder.

App Store: Customize Reviews Widget

How to change the layout, number of columns, settings and customize your reviews widget in your responsive website builder

App Store: Facebook Feed

How to setup your Facebook page feed and add it to your responsive website

App Store: Import Reviews

Bulk import reviews you've collected from other platforms like Trustpilot, Tripadvisor, Airbnb, Capterra, Trustradius, chat or email

App Store: Custom Reviews

Steps on how you can create your custom reviews, and display them on your responsive website builder.

App Store: Custom CSS

Frequently used CSS classes to customize your social media feed in your responsive website builder.

App Store: Multiple Hashtag Feeds

Steps on how to create multiple Instagram hashtag feeds in your responsive website builder.

App Store: TikTok Videos

Steps on how to generate and embed your TikTok videos in your responsive website builder with EmbedFeed.

App Store: Vimeo Feed

Steps on how you can generate your Vimeo videos in EmbedFeed application and easily display them in your responsive website builder.

App Store: YouTube Videos

Steps on how to generate and embed a YouTube hashtag videos in your responsive website builder.

App Store: Instagram Feed

Steps on how to generate an Instagram account feed and embed it in your responsive website builder.

App Store: Instagram Hashtags

How to aggregate and embed an Instagram hashtag feed and display it in your responsive website builder.

Automation Tools

How to connect EmbedSocial to automation tools like Zapier, Make, and Slack.

Shopwired

Steps on how you can embed the EmbedSocial code in Shopwired.

Bubble

Steps and instructions on how you can embed and display your social media feeds on your Bubble website

IM Creator

Steps and instructions on how you can embed and display your social media feeds on your IM Creator website.

Magento

Steps and instructions on how you can setup the EmbedSocial plugin for your Magento ecommerce store

WooCommerce

Steps and instructions on how you can embed and display your social media posts on your WooCommerce website

TypeDream

Steps and instructions on how you can embed and display your social media feeds on your TypeDream site

Framer

Steps and instructions on how you can embed and display your social media feeds on your Framer website.

Mozello

Steps and instructions on how you can embed and display your social media feeds on your Mozello website.

Unicorn Platform

Steps and instructions on how you can embed and display your social media feeds in Unicorn Platform

BoldGrid

Steps and instructions on how you can embed and display your social media feeds on your BoldGrid website.

Webnode

Steps and instructions on how you can embed and display your social media feeds on your Webnode website.

Ghost

Steps and instructions on how you can embed and display your social media feeds on your Ghost website builder.

Jimdo

Steps and instructions on how you can embed and display your social media feeds in Jimdo

Voog

Steps and instructions on how you can embed and display your social media feeds on your Voog website

Brizy

Steps and instructions on how you can embed and display your social media feeds on your Brizy website

WordPress

Steps and instructions on how you can embed and display your social media feeds on your WordPress website.

Wix

Steps and instructions on how you can embed and display your social media feeds on your Wix website.

GoDaddy

Steps and instructions on how you can embed and display your social media feeds on your GoDaddy website

Google Sites

Steps and instructions on how you can embed and display your social media feeds on your Google Site.

Squarespace

Steps and instructions on how you can embed and display your social media feeds on your Squarespace website.

Weebly

Steps and instructions on how you can embed and display your social media feeds on your Weebly website

Kentico

Steps and instructions on how you can embed and display your social media feeds on your Kentico website.

Volusion

Steps and instructions on how you can embed and display your social media feeds on your Volusion website.

HubSpot

Steps and instructions on how you can embed and display your social media feed on your Hubspot page

Landingi

Steps and instructions on how you can embed and display your social media feeds in Landingi

LanderApp

Steps and instructions on how you can embed and display your social media feeds in LanderApp

FastPages

Steps and instructions on how you can embed and display your social media feeds in FastPages.

Moosend

Steps and instructions on how you can embed and display your social media feeds on your Moosend page

PageCloud

Steps and instructions on how you can embed and display your reviews on your PageCloud website.

GetResponse

Steps and instructions on how you can embed and display your social media feeds on your GetResponse page

Webflow

Steps and instructions on how to display reviews from Google, Facebook, or Yelp on your Webflow website.

Unbounce

Steps and instructions on how you can embed and display your social media feeds on your Unbounce page

Leadpages

Steps and instructions on how you can embed and display your social media feeds on your Leadpages landing pages and website.

Instapage

Steps and instructions on how you can embed and display your social media feeds on Instapage

Elementor

Steps and instructions on how you can embed and display your social media feeds on your Elementor page

ClickFunnels

Steps and instructions on how you can embed and display your social media feeds in ClickFunnels

Notion

Steps and instructions on how you can embed and display your social media feeds on your Notion document.

Linktree

Steps and instructions on how you can embed and display your social media feeds in Linktree

Pagewiz

Steps and instructions on how you can embed and display your social media feeds on your Pagewiz page

KickoffLabs

Steps and instructions on how you can embed and display your social media feeds in KickoffLabs

Zoho

Steps and instructions on how you can embed and display your reviews on your Zoho website.

Kajabi

Steps and instructions on how you can embed and display your social media feeds on your Kajabi site

Shopify

Steps and instructions on how you can embed and display your Google, Facebook or Yelp reviews in your Shopify pages.

Thinkific

Steps and instructions on how you can embed and display your social media feeds on Thinkific

BigCommerce

Steps and instructions on how to integrate your social media feeds in your BigCommerce store.

Blogger

Steps and instructions on how you can embed and display your social media feeds on your Blogger pages or posts.

LearnDash

Steps and instructions on how you can embed and display your reviews on your LearnDash courses builder!

Beacons.ai

Steps and instructions on how you can embed and display your reviews in Beacons.ai

Tumblr

Steps and instructions on how you can embed and display your reviews on your Tumblr blog

Can't find what you're looking for?

Our support team is here to help. Reach out and we'll get back to you within 24 hours.

Contact support