Embedding Fomo in a Javascript-Only Environment

Most online platforms like Shopify, BigCommerce, ClickFunnels, Teachable, Google Tag Manager, etc allow you to embed custom HTML and Script tags like Fomo.

However, if you use a tool like Kartra to run your online business, you may be unable to insert the Fomo script tag on your website, which looks like this:

 

This is because some apps only allow custom "JavaScript" injection, whereas the Fomo snippet is an HTML tag.

We've created a simple workaround to fix this.

Step 1 - Get your Fomo Snippet

Inside Fomo, navigate to Settings > Embed.

Copy to your clipboard the text between /api/v1/  and /load, it will be a string of digits and numbers. We'll need it in the next step.

Step 2 - Create a Javascript-only Fomo Snippet

Since you can't paste this tag directly into your app, instead take the following code:

var loadScript = function(location, callback){
  var fileRef = document.createElement('script');
  fileRef.setAttribute('type','text/javascript');
  fileRef.setAttribute('src', location);
  document.head.appendChild(fileRef);
};
loadScript("https://load.fomo.com/api/v1/XXXXXXX/load.js");

To make this work on your website, replace the "XXXXX" value on the last line (between "/v1/" and "/load.js") with the string of characters from your own Fomo script tag (Step 1).

Step 3 - Embed your new snippet

Inside your tool of choice (that does not allow HTML injection, only pure JavaScript), paste the entire snippet of code we created in Step 2.

Save your settings. Fomo will now work on your website without HTML injection functionality.

Email hello@fomo.com if you need any help with this embed process.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.