Skip to content

Instantly share code, notes, and snippets.

View ZeldOcarina's full-sized avatar
👩‍💻
Coding!

Mattia Rasulo ZeldOcarina

👩‍💻
Coding!
  • Monarchy Media LLC
View GitHub Profile
/* on the headers add "Content/Type: application/json" and "Authorization [api_key] */
{
"event_name": event_name,
"contact": {
"email": email,
"first_name": first_name,
"last_name": last_name,
"phone_number": phone_number,
"custom_attributes": {
/* use uuids of the custom attribute here */
@ZeldOcarina
ZeldOcarina / gist:5de2ba6d446767ef9a89fc1fbf3c3226
Created January 15, 2021 22:23
Sales Jet Affiliate Codes
function queryOrganizer(queries) {
return queries
.replace("?", "")
.split("&")
.reduce(function (acc, query) {
return [...acc, { [query.split("=")[0]]: query.split("=")[1] }];
}, []);
}
queries = queryOrganizer(window.location.search);
@ZeldOcarina
ZeldOcarina / connectToSalesJet.js
Last active February 12, 2021 17:34
A Javascript function to connect any external app to Sales Jet.
// USE THIS FUNCTION TO CONNECT ANY EXTERNAL APP TO SALES JET:
async function submitToSalesJet(api_key, event_name, email, first_name, last_name) {
try {
const response = await fetch("https://sj-api.com/externalapp/track", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: api_key // YOUR API KEY GOES HERE
},