and runs during HTML parse, but hubspotutk is set by
js.hs-analytics.net, measured loading at ~834ms. On a first visit the cookie
does not exist yet, so a single read returns nothing and the visitor gets no
external ID at all — and a first visit is exactly what an ad click is. So
poll briefly until HubSpot sets it. The SDK loads lazily (~4.5s) and replays
a queue, so an init queued a second or two in still lands before any events
are transmitted. */
(function attachExternalId() {
var attempts = 0;
var MAX_ATTEMPTS = 40; /* 40 x 200ms = 8s, then give up quietly */
var timer = null;
function tryAttach() {
var raw = getExternalId();
if (!raw) {
if (++attempts >= MAX_ATTEMPTS && timer) clearInterval(timer);
return;
}
if (timer) clearInterval(timer);
sha256Hex(raw).then(function (hash) {
oaiq("init", { user: { external_id_sha256: hash } });
}).catch(function () {});
}
tryAttach(); /* returning visitor: immediate */
if (!getExternalId()) timer = setInterval(tryAttach, 200);
})();
/* ---------------------------------------------------------------------------
2. Load the SDK off the critical path
Whichever comes first: the main thread going idle after load, or the first
sign of real user intent. No preconnect on purpose — a TLS handshake during
LCP for a script we deliberately deferred is a net loss.
Measured on clickpost.ai: load event 3614ms, SDK fetched 4508ms.
------------------------------------------------------------------------ */
var loaded = false;
var INTENT = ["pointerdown", "keydown", "scroll"];
function loadSdk() {
if (loaded) return;
loaded = true;
INTENT.forEach(function (t) { removeEventListener(t, loadSdk, { passive: true }); });
var s = document.createElement("script");
s.src = SDK;
s.async = true;
s.fetchPriority = "low";
document.head.appendChild(s);
}
INTENT.forEach(function (t) {
addEventListener(t, loadSdk, { passive: true, once: true });
});
addEventListener("load", function () {
window.requestIdleCallback
? requestIdleCallback(loadSdk, { timeout: 2500 })
: setTimeout(loadSdk, 1500);
}, { once: true });
/* ---------------------------------------------------------------------------
3. Conversion id
sha256(lowercase(email) + "|" + formId + "|" + ISO-hour), first 20 hex,
"lead_" prefix.
- email lowercased/trimmed so casing does not fork the id
- formId keeps two different forms in the same hour from colliding
- the hour bucket is only the server's fallback; the id computed here is
sent to the relay verbatim, so the two paths cannot disagree even when
a submit straddles an hour boundary
Ads Manager's own sample omits event_id. We send it so the pixel event and
the relay event collapse into one conversion instead of counting twice.
------------------------------------------------------------------------ */
function buildEventId(email, formId) {
var seed = [
String(email || "").trim().toLowerCase(),
String(formId || ""),
new Date().toISOString().slice(0, 13)
].join("|");
return crypto.subtle.digest("SHA-256", new TextEncoder().encode(seed)).then(function (buf) {
var hex = Array.prototype.map.call(new Uint8Array(buf), function (b) {
return b.toString(16).padStart(2, "0");
}).join("");
return "lead_" + hex.slice(0, 20);
});
}
/* Guards a re-fire from the history.pushState that book-a-demo-core.js runs
after submit, and from back-navigation onto the same state. */
function firedOnce(id) {
try {
if (sessionStorage.getItem("oaiq_" + id)) return true;
sessionStorage.setItem("oaiq_" + id, "1");
return false;
} catch (e) {
return false; /* private mode / blocked storage: fire rather than lose it */
}
}
/* Path 2. keepalive lets the request finish even if the page navigates away.
Failures are swallowed deliberately: a reporting call must never surface an
error to someone who just submitted a form.
The relay hashes the email server-side into user.emails_sha256 and adds the
caller's IP and user agent, so this event carries the same match signals the
pixel gets for free. */
function sendToRelay(email, formId, eventType, eventId) {
try {
var payload = {
token: RELAY_TOKEN,
email: email,
form_id: formId || "",
event_type: eventType,
event_id: eventId, /* verbatim, so both paths always match */
source_url: location.href
};
var oppref = getOppref();
if (oppref) payload.oppref = oppref;
var externalId = getExternalId();
if (externalId) payload.external_id = externalId;
fetch(RELAY_URL, {
method: "POST",
keepalive: true,
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
}).catch(function () {});
} catch (e) {}
}
/* Capture the email while the form is still on the page. onFormSubmitted does
not reliably carry submissionValues, and by then the form may be removed. */
var lastEmail = "";
document.addEventListener("submit", function (e) {
var f = e.target;
if (!f || !f.querySelector) return;
var i = f.querySelector('input[name="email"], input[type="email"]');
if (i && i.value) lastEmail = i.value;
}, true);
/* Every HubSpot form on the site reports through this one message event, so no
module or theme JS needs editing to add coverage. */
window.addEventListener("message", function (e) {
var d = e.data;
if (!d || d.type !== "hsFormCallback" || d.eventName !== "onFormSubmitted") return;
var email = (d.data && d.data.submissionValues && d.data.submissionValues.email) || lastEmail;
if (!email) return; /* without an email there is no stable id to dedupe on */
var eventType = EVENT_BY_FORM[d.id] || EVENT_DEFAULT;
buildEventId(email, d.id).then(function (id) {
if (firedOnce(id)) return;
oaiq("measure", eventType, { type: DATA_TYPE }, { event_id: id }); /* path 1 */
sendToRelay(email, d.id, eventType, id); /* path 2 */
});
});
})();
Track Saee Logistics Packages with the ClickPost Tracking Page
Find your Saee Logistics tracking number or ID.
Visit the Clickpost Tracking Page
In the box provided, enter your tracking number.
Click “Track” to retrieve your live tracking status.
Track Saee Logistics Packages on the Official Page
Go to the official Saee Logistics tracking page.
Type your baggage/shipment number.
Select the magnifying glass icon on the right hand side.
View your tracking details.
List of Saee Logistics APIs
API
Description
Manifestation and shipping label generation API
Automatically generate shipping labels and manifest orders with Saee Logistics.
Track Shipment API
Keep customers updated on their order’s tracking status in real-time.
Cancellation API
Customers changing their mind about a product midway? Cancel any order using this API.
EDD API
Display accurate delivery estimates to customers on product pages.
NDR Action Update
Initiate immediate action for failed deliveries and keep RTO rates at a minimum.
Return Webhooks
Smart Saee Logistics-integrated webhooks let you easily begin processing a return order.
API & Description
Manifestation and shipping label generation API
Automatically generate shipping labels and manifest orders with Saee Logistics.
Track Shipment API
Keep customers updated on their order’s tracking status in real-time.
Cancellation API
Customers changing their mind about a product midway? Cancel any order using this API.
EDD API
Display accurate delivery estimates to customers on product pages.
NDR Action Update
Initiate immediate action for failed deliveries and keep RTO rates at a minimum.
Return Webhooks
Smart Saee Logistics-integrated webhooks let you easily begin processing a return order.
Frequently asked questions
1. How does ClickPost enable real-time tracking for Saee Logistics shipments?
Once integrated, ClickPost automatically retrieves real-time tracking data from Saee’s network and displays it on the main dashboard. Similarly, you can show this information to customers on a tracking page.
2. Can ClickPost automate dispatch and tracking for Saee Logistics through API integration?
Yes, ClickPost can automate both dispatch and tracking for brands using Saee Logistics. This will help you save time in allocating resources to the right people. Additionally, you can optimize tracking by letting customers see tracking details using a dedicated page and send automated notifications during specific delivery milestones.
3. How frequently are tracking updates refreshed for Saee Logistics on ClickPost?
When it comes to tracking updates, customers are sent timely alerts whenever the shipment reaches a new milestone. The same is also reflected in the tracking page.
4. Does ClickPost support multi-city and cross-border shipping with Saee Logistics?
Absolutely. Once connected, online stores can benefit from all the services of Saee Logistics. Since the company is focused on offering last-mile delivery to Saudi businesses, ClickPost can facilitate mulit-city shipments. However, online stores should get in touch with Saee’s support team to confirm if they handle international deliveries.
5. What is Saee Logistics API?
Saee Logistics is a new logistics company that is based in Jeddah, Saudi Arabia. Founded in 2017, it focuses largely on providing ecommerce stores last-mile delivery services. However, it also hosts other benefits, such as 3PL and express delivery. As of current, the company has held a strong 99% success delivery rate on all prepaid orders and has delivered 3.5 million shipments altogether. When it comes to shipment size, Saee Logistics dispatches 15,000+ packages every day and has a network of 14 distribution centers and reaches 350 cities. Coming back to its expertise—last mile delivery. The company offers both same and next-day delivery options to online stores along with COD (cash on delivery) and door-to-door shipping. If needed, businesses can also assign emergency shipments and have it delivered within a couple of hours using the “Bullet Delivery” service. From last-mile delivery to 3PL solutions, Saee Logistics combines the best of both worlds, enabling ecommerce (and other industry) businesses to fulfill orders on time and leverage smart logistics.