A Google Tag Manager custom tag template that installs the JustAd Pixel. It
initializes the global justad() command queue and asynchronously loads the
JustAd SDK using your Advertiser ID.
This template is the sandboxed-JavaScript equivalent of the standard JustAd snippet:
<!-- JustAd Pixel -->
<script>
window.justad = window.justad || function () {
(window.justad.q = window.justad.q || []).push(arguments);
};
</script>
<script async src="https://sdk.just.ad/a.js?a={{Advertiser_id}}"></script>
<!-- End JustAd Pixel -->Because GTM custom templates run in Sandboxed JavaScript
(raw <script> injection is not allowed), the snippet is implemented with:
createArgumentsQueue('justad', 'justad.q')— creates the globalwindow.justadstub function that pushes its arguments onto thewindow.justad.qqueue.injectScript('https://sdk.just.ad/a.js?a=<Advertiser ID>')— loads the SDK asynchronously.
| Field | Required | Description |
|---|---|---|
| Advertiser ID | Yes | Your JustAd Advertiser ID. Passed to the SDK as the a query parameter. Can be set with a GTM variable, e.g. {{Advertiser ID}}. |
- In Google Tag Manager, go to Templates → New (Tag Templates).
- Open the overflow menu and choose Import, then select
template.tpl. - Save the template.
- Create a new tag using the JustAd Pixel template, set the Advertiser ID, and add a trigger (typically All Pages / Initialization).
- Accesses global variables:
justad,justad.q(read, write, execute). - Injects scripts:
https://sdk.just.ad/*.
.
├── template.tpl # The GTM custom template (import this into GTM)
├── metadata.yaml # Community Template Gallery metadata
├── LICENSE # Apache 2.0
└── README.md
This repo follows the Community Template Gallery structure. Before submitting:
- Confirm the "Agree to the Community Template Gallery Terms of Service" box is checked in the template's Info tab.
- Update
metadata.yaml:- Set
homepageanddocumentationto real URLs. - Replace
REPLACE_WITH_COMMIT_SHAwith the commit SHA of the release.
- Set
- Push to a public GitHub repo with
template.tpl,metadata.yaml, andLICENSEat the repository root on themainbranch, with Issues enabled. - Submit the repository URL at tagmanager.google.com/gallery.
Apache License 2.0. See LICENSE.