This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function queryOrganizer(queries) { | |
return queries | |
.replace("?", "") | |
.split("&") | |
.reduce(function (acc, query) { | |
return [...acc, { [query.split("=")[0]]: query.split("=")[1] }]; | |
}, []); | |
} | |
queries = queryOrganizer(window.location.search); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
}, |
NewerOlder