Skip to content

Instantly share code, notes, and snippets.

View jittarao's full-sized avatar

Raghavender Rao Jitta jittarao

View GitHub Profile
<script>
/* Hide Gist Messenger Launcher on page load */
gist.chat('hideLauncher');
/* open the Messenger when you receive a message */
document.addEventListener("onGistUnreadCountChange", function(e) {
if(window.gistUnreadCount > 0) {
gist.chat('open');
}
});
// This callback gets executed once Gist Messenger is fully loaded and all gist.chat() API methods are available
document.addEventListener('gistChatReady', function () {
gist.chat("sidebar");
gist.chat("navigate", 'articles');
});
<<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
iframe {
width: 100%;
height: 100vh;
padding: 0;
margin: 0;
{% if subscriber.country == "United States"%}
Subscribers from USA will see this
{% elsif subscriber.country == "Italy" %}
Subscribers from Italy will see this
{% else %}
Subscribers from other countries will see this
{% endif %}
<!-- place this script tag after the Gist & Segment tracking code -->
<script>
// sends logged-in user data to Gist when Segment's identify method is called
analytics.on('identify', function(event, properties, options) {
gist.identify(event ? event : '', properties);
});
// sends events to Gist when Segment's track method is called
analytics.on('track', function(event, properties, options) {
gist.track(event, properties);
<!-- place this script tag after the Gist tracking code -->
<script>
// open the Messenger widget when you receive a message
document.addEventListener('gistChatReady', function () {
document.addEventListener("onGistUnreadCountChange", function(e) {
if (window.gistUnreadCount > 0 || $('.gist-messenger-iframe').css('display') === 'block') {
gist.chat("showLauncher");
} else {
gist.chat("hideLauncher");
}
<!-- start Gist JS code-->
<script type="text/javascript">
//<![CDATA[
var WORKSPACE_ID = "XXXXXXX" // Replace XXXXXXX with your Workspace ID
(function(d,h,w){var gist=w.gist=w.gist||[];gist.methods=['trackPageView','identify','track','setAppId'];gist.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);gist.push(e);return gist;}};for(var i=0;i<gist.methods.length;i++){var c=gist.methods[i];gist[c]=gist.factory(c)}s=d.createElement('script'),s.src="https://widget.getgist.com",s.async=!0,e=d.getElementsByTagName(h)[0],e.appendChild(s),s.addEventListener('load',function(e){},!1),gist.setAppId(WORKSPACE_ID),gist.trackPageView()})(document,'head',window);
//]]>
</script>
<!-- end Gist JS code-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="x-apple-disable-message-reformatting"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>Gist</title>
<style>
.personal-email {
import React from "react";
import { useEffect } from "react";
export default function App() {
useEffect(() => {
const script = document.createElement("script");
script.src = "https://meeting-widget.getgist.com/";
script.async = true;