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 */
});
});
})();
Thabit Logistics Tracking and API Integration with ClickPost
Bring down your shipping costs by 29% using smart automations to deliver products!
Trusted by 600+ global brands
Thabit Logistics Tracking
*ClickPost provides package tracking services only. For inquiries about order details, please contact your retailer.
Benefits of Connecting with Thabit Logistics Through ClickPost
While Thabit Logistics ensures your parcels are delivered, ClickPost ensures it gets there faster in a cost-effective manner.
Reduce your shipping delays by 20% using personalized tracking updates that keep customers in the loop at all times.
Experience a 65% rise in operational efficiency using logistics intelligence that let you eliminate various manual tasks and automate shipping label printing.
Grow your NPS ratings by 20% with a smart shipping solution that automates carrier allocation and helps you deliver on time.
Track Thabit Logistics Packages with ClickPost Tracking Page
Check and note your Thabit Logistics tracking number.
Visit the Clickpost Tracking Page
Enter your tracking number in the space given.
Click on the “Track” button to view your parcel’s status.
Track Thabit Logistics Packages on the Official Page
Visit Thabit Logistics’ tracking page.
Fill the box with your shipment’s AWB number.
Hit the “Track Now” option.
View your shipment’s current tracking status.
List of Thabit Logistics’ APIs
API
Description
Manifestation and shipping label generation API
Automate shipping label generation and quickly manifest any order in Thabit Logistics.
Track Shipment API
Fetch live tracking data of any Thabit Logistics-related order instantly.
Cancellation API
Cancel any order you want with this API in case a customer switches their buying decision at the last-minute.
EDD API
Display precise delivery estimates on product pages and let visitors make smarter purchases
NDR Action Update
Immediately take action for any failed delivery and keep RTO rates as low as possible.
Return Webhooks
Gain Thabit Logistics-integrated webhooks to quickly process returns.
API & Description
Manifestation and shipping label generation API
Automate shipping label generation and quickly manifest any order in Thabit Logistics.
Track Shipment API
Fetch live tracking data of any Thabit Logistics-related order instantly.
Cancellation API
Cancel any order you want with this API in case a customer switches their buying decision at the last-minute.
EDD API
Display precise delivery estimates on product pages and let visitors make smarter purchases
NDR Action Update
Immediately take action for any failed delivery and keep RTO rates as low as possible.
Return Webhooks
Gain Thabit Logistics-integrated webhooks to quickly process returns.
Frequently asked questions
1. Can ClickPost automate dispatch and tracking for Thabit Logistics orders?
Yes, ClickPost can automate the dispatch and tracking process for all Thabit Logistics-based orders. You can easily send packages at the right times and give customers real-time tracking updates via sending automated notifications and/or directing them to a branded tracking page.
2. Does ClickPost manage exceptions and NDR for Thabit Logistics shipments?
ClickPost can easily manage any failed deliveries and exceptions for shipments fulfilled by Thabit Logistics. You’ll find these in their respective dashboards. If needed, you can always contact our support team in case you can't find any specific shipment.
3. Is it possible to generate manifests and labels automatically for Thabit Logistics through ClickPost?
Absolutely. With ClickPost’s Thabit Logistics integration, you can automate order manifestation and generate shipping labels instantly. These let you speed up the fulfillment process.
4. How does ClickPost optimize delivery timelines for Thabit Logistics shipments?
The main benefit of using ClickPost is automating your shipping processes. These enable Thabit Logistics to quickly process each order and ship it on time. Our SLA adherence policies also ensure every carrier delivers their promised services.
5. What is Thabit Logistics API?
Thabit, a Saudi-based company is a relatively new addition to the logistics market and was founded in 2020. The firm mainly focuses on providing express delivery services in KSA. While it currently serves only Riyadh, Jeddah, Makkah, Dammam, and Abha, Thabit aims to expand its reach to all of Saudi Arabia. Primarily, Thabit Logistics enables e-commerce and small businesses in the KSA region to deliver products to customers. It follows an extensive and clear process from pickup to obtaining proof of delivery. If needed, businesses can leverage its return pickup and RTO (return to origin) services. All orders once picked are sent to Thabit’s warehouse to process and assigned to specific delivery agents to deliver. Once your customer receives an order, the company updates the shipping records to ensure you have up-to-date information on your parcels.
Streamline your shipping experience with ClickPost