(async function () { const stateStr = localStorage.getItem("state"); if (!stateStr) { return; } const { currentUser } = JSON.parse(stateStr); if (!currentUser || !currentUser.token) { return; } // Check user is set correctly and is an admin const { user } = currentUser; if (!user || Number(user.accountType) < 100) { return; } const path = window.location.pathname; const ifrm = document.createElement("iframe"); ifrm.setAttribute( "src", `/off-site/long-tail-analytics?path=${encodeURIComponent(path)}` ); ifrm.setAttribute("width", "550px"); document.body.insertBefore(ifrm, document.body.firstChild); })();