Skip to content

Instantly share code, notes, and snippets.

View JackGJenkins's full-sized avatar

Jack Jenkins JackGJenkins

View GitHub Profile
@JackGJenkins
JackGJenkins / functions.php
Last active September 19, 2019 22:05
This is some sample code that allows you to install Intercom via your child theme's functions.php file without the plugin.
<?php
global $wp;
function is_page_to_exclude(){
/* Replace these examples with any pages where you'd like the messenger to be hidden */
$urls_to_exclude = array(
"http://example.com/page-one",
"http://example.com/page-two",
"http://example.com/page-three"
);
$url_to_check = home_url(add_query_arg(array(),$wp->request));
@JackGJenkins
JackGJenkins / show_intercom_launcher_after_scroll_or_action.js
Last active August 22, 2019 16:51
Simple jQuery snippet to show the Intercom messenger launcher when your user scrolls to the bottom of the page, or clicks a button.
//SHOW THE LAUNCHER WHEN A USER SCROLLS TO THE BOTTOM OF YOUR PAGE
//You'll need to have 'hide_default_launcher: true' defined in your intercomSettings object when the page loads initially.
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
Intercom('update', {"hide_default_launcher": false});
}
});
//SHOW THE LAUNCHER AFTER A USER CLICKS A BUTTON
@JackGJenkins
JackGJenkins / unsubscribe-in-Intercom.html
Created August 24, 2018 04:58
Host this file (or one like it) on your server, and you can use it to unsubscribe a user in Intercom from other sources. For example, by adding a link in an email sent from another app, or directly.
<html>
<head>
<meta name="robots" content="noindex, nofollow" />
<link rel="stylesheet" media="screen, projection" href="https://static.intercomassets.com/assets/unsubscribe-eb55a149a7ee2dbea877ffb83e6db0c0c66e6658fd96b802a2d4aad6ebcc7502.css" />
</head>
<body>
<div id="unsubscribe">
<h2>Your App Name Here</h2>
@JackGJenkins
JackGJenkins / unsubscribe-in-Intercom.html
Last active August 24, 2018 05:00
Host this file (or one like it) on your server, and you can use it to unsubscribe a user in Intercom from other sources. For example, by adding a link in an email sent from another app, or directly. Pass in the Intercom user_id of the user you wish to unsubscribe as a URL query string called "id". Add your workspace ID on line 25 before using.
<html>
<head>
<meta name="robots" content="noindex, nofollow" />
<link rel="stylesheet" media="screen, projection" href="https://static.intercomassets.com/assets/unsubscribe-eb55a149a7ee2dbea877ffb83e6db0c0c66e6658fd96b802a2d4aad6ebcc7502.css" />
</head>
<body>
<div id="unsubscribe">
<h2>Your App Name Here</h2>
@JackGJenkins
JackGJenkins / EasyEngine-SSL-Article.md
Last active January 14, 2019 02:07
If you're running EasyEngine on an Nginx Server, follow these instructions to add your new Intercom custom help center domain to your server, encrypt it with SSL via LetsEncrypt, and proxy the traffic over to Intercom’s help center.

INSTRUCTIONS KINDLY PROVIDED BY JESSICA FROM TELECOM.LIVE

We will start this tutorial assuming that you already created a site using EasyEngine, and need to add a sub domain help.example.com, where example.com is to be replaced with your domain in all areas mentioned below. This tutorial is based on the os for Ubuntu 16.04 LTS, but should work on most Linux.

Update DNS Records:

(Note: If you have already setup a CNAME to point to custom.intercom.help — as per Intercom’s instructions — you need to delete that or the two settings will conflict and will lead to unpredictable results.)

The first step is to go to your DNS and add two A records (it’s very important that you add both your help.example.com and www.help.example.com domains otherwise LetsEncrypt will not issue a second SSL for your server!). Point the following domains: