Skip to content

Instantly share code, notes, and snippets.

@SeanMancillas
SeanMancillas / locale.js
Created March 13, 2020 13:23
locale.js
<script type="text/javascript">
!function(e,t,r,n,a){if(!e[a]){for(var i=e[a]=[],s=0;s<r.length;s++){var c=r[s];i[c]=i[c]||function(e){return function(){var t=Array.prototype.slice.call(arguments);i.push([e,t])}}(c)}i.SNIPPET_VERSION="1.0.1";var o=t.createElement("script");o.type="text/javascript",o.async=!0,o.src="https://d2yyd1h5u9mauk.cloudfront.net/integrations/web/v1/library/"+n+"/"+a+".js";var p=t.getElementsByTagName("script")[0];p.parentNode.insertBefore(o,p)}}(window,document,["survey","reset","config","init","set","get","event","identify","track","page","screen","group","alias"],"1234","delighted");
delighted.survey({
email: "customer@hemandstitch.com", // customer email (optional)
name: "Bailey Dixon", // customer name (optional)
properties: { // extra context (optional)
customerId: "123ABC",
locale: "en-x-monotype-2"
}
@SeanMancillas
SeanMancillas / sample.js
Created February 27, 2019 00:29
sample.js
var mobileScoreOrdering = Math.random() < 0.5 ? "asc" : "desc";
delighted.survey({
...,
mobileScoreOrdering: mobileScoreOrdering,
properties: { mobileScoreOrdering: mobileScoreOrdering, ... }
});
@SeanMancillas
SeanMancillas / example.js
Created February 21, 2018 13:03
example.js
<script type="text/javascript">
!function(e,t,r,n,a){if(!e[a]){for(var i=e[a]=[],s=0;s<r.length;s++){var c=r[s];i[c]=i[c]||function(e){return function(){var t=Array.prototype.slice.call(arguments);i.push([e,t])}}(c)}i.SNIPPET_VERSION="1.0.1";var o=t.createElement("script");o.type="text/javascript",o.async=!0,o.src="https://d2yyd1h5u9mauk.cloudfront.net/integrations/web/v1/library/"+n+"/"+a+".js";var p=t.getElementsByTagName("script")[0];p.parentNode.insertBefore(o,p)}}(window,document,["survey","reset","config","init","set","get","event","identify","track","page","screen","group","alias"],"Wt3KWnIjQKT0SgVY","delighted");
delighted.survey({
email: "customer@hemandstitch.com", // customer email (optional)
name: "Customer Name", // customer name (optional)
properties: { // extra context (optional)
customerType: "New",
userID: "12345",
location: "New York"