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 Naqel Express Packages with the ClickPost Tracking Page
Retrieve your Naqel Express tracking number.
Visit the Clickpost Tracking Page
Enter the Naqel Express tracking ID in the designated area.
Hit “Track” to get real-time shipping updates.
Track Naqel Express Packages on the Official Page
Head over to the Naqel Express official website.
Provide the reference numbers or waybills in the input area.
You can enter multiple waybills, separated by commas.
Click the “Track” button to proceed. Within a few seconds, the latest status will be displayed on the screen.
List of Naqel Express APIs
API
Description
Manifestation and Label Generation API
Manifest Naqel Express orders and generate shipping labels with just a few taps.
Track Shipment API
Monitor the Naqel Express status live via the Naqel Express network.
Cancellation API
Use this API to cancel shipments easily
EDD API
Win customers’ loyalty by displaying the expected delivery date of their orders.
NDR Action Update
Bring down RTO% by instantly taking action on shipping exceptions.
Return Webhooks
Kick off returns seamlessly with DTDC-integrated webhooks.
API & Description
Manifestation and Label Generation API
Manifest Naqel Express orders and generate shipping labels with just a few taps.
Track Shipment API
Monitor the Naqel Express status live via the Naqel Express network.
Cancellation API
Use this API to cancel shipments easily
EDD API
Win customers’ loyalty by displaying the expected delivery date of their orders.
NDR Action Update
Bring down RTO% by instantly taking action on shipping exceptions.
Return Webhooks
Kick off returns seamlessly with DTDC-integrated webhooks.
Frequently asked questions
Everything you need to know about ClickPost’s Carriers Integration
How does ClickPost use AI for Carrier Allocation?
ClickPost uses AI-driven algorithms to analyze multiple factors, such as cost, turnaround times, SLA Adherence for carriers, to recommend the best carrier for each shipment.
How does ClickPost use AI for Carrier Allocation?
ClickPost uses AI-driven algorithms to analyze multiple factors, such as cost, turnaround times, SLA Adherence for carriers, to recommend the best carrier for each shipment.
How does ClickPost use AI for Carrier Allocation?
ClickPost uses AI-driven algorithms to analyze multiple factors, such as cost, turnaround times, SLA Adherence for carriers, to recommend the best carrier for each shipment.
How does ClickPost use AI for Carrier Allocation?
ClickPost uses AI-driven algorithms to analyze multiple factors, such as cost, turnaround times, SLA Adherence for carriers, to recommend the best carrier for each shipment.
What does the Naqel Express and ClickPost API integration enable?
When you go for the Naqel Express and ClickPost API integration, it enables you to manage the entire logistics process more efficiently with advanced automation technology and a customer-centric approach. Through this integration, you can bring together the best of both platforms and automate the entire process, like order creation, tracking, NDR management, customer alerts, and returns.
Does ClickPost support Naqel Express in both Arabic and English?
Yes! ClickPost supports Naqel Express services in both Arabic and English. In fact, it’ll also allow you to configure customer alerts, the tracking page, and the return portal in your preferred language.
How can I activate Naqel Express as a carrier with ClickPost?
ClickPost already comes pre-integrated with 500+ carriers, along with Naqel Express, and offers a universal API for them. Hence, you can activate Naqel Express as a carrier with ClickPost with just a few clicks. Contact our team, and they will assist you at each step of onboarding.
Can I track all Naqel Express shipments using ClickPost’s dashboard?
Yes! ClickPost offers a unified dashboard where you can monitor multiple Naqel Express consignments at once. You can also monitor all ongoing shipments with other integrated carriers.
What is Naqel Express API?
Naqel Express entered the market in 2005 as a joint venture between Hala Express and Saudi Post. Its growth story took a significant turn in 2022 when Saudi Post fully acquired Naqel Express, aiming for national-scale expansion and logistics integration for global reach. Naqel Express operates the largest network in KSA and is serviceable across 16 major countries planet-wide. With 4,900+ delivery points, including all cities, towns, and villages, and 4,000+ vehicles and trailers, this logistics giant powers nationwide connectivity and seamless delivery experiences for businesses and individuals. It has successfully managed over 2M shipments to date. By 2030, Naqel Express aspires to become the go-to logistics company in the MENA region and expand its footprint in countries like Asia and Europe. Though Naqel Express offers comprehensive logistics management services to customers, it is mostly renowned for express courier delivery and international shipping services. Additionally, customs clearance, returns management, and warehousing are some value-added services offered by Naqel Express. Notably, it was the first company in the MENA region to introduce tracking solutions via Alexa voice assistance
Streamline your shipping experience with ClickPost