$ var basePath='/abc';

<script type="application/json">
${JSON.stringify({
        "requests": {
            "base": basePath,
            "pageview": "\${base}=\${ping}",
            "event": "\${base}=\${track}"
        }
})}
</script>