Skip to main content

JTag Integration

Quick integration guide for the MageAds Platform — client-side JavaScript Tag.

Version 1.0.2 — June 2026

What is JTag?

JTag (JavaScript Tag) is an HTML code snippet that the Publisher pastes onto their website. Once pasted, the code automatically connects to the MageAds platform and displays ads in selected locations — without the need to install anything on the server or involve a developer.

JTag works similarly to Google AdSense or Facebook Pixel: the Publisher copies the code from the panel and pastes it into their page template or CMS system. MageAds takes care of the rest.

Key advantage: All ad display logic runs on the MageAds side. The Publisher does not need to modify their backend, configure a server, or hire a developer.

Platform Compatibility

JTag works on all platforms that support HTML code editing, in particular:

Platform typeCompatibilityDetails
SaaS e-commerce (Shopify, IDoSell, BaseLinker, PrestaShop)✅ YESNo access to backend code — the only working integration method
WordPress / Joomla (blogs, portals)✅ YESAdding the code via WPCode, Custom HTML widget, or Gutenberg block
Static pages (landing pages, single-page)✅ YESCode is pasted directly into the <body> section
Custom backend (PHP, Node.js, Python)✅ YESClassic server-side connection also possible

Benefits for the Publisher

Quick Deployment

After a one-time configuration in the MageAds panel, the Publisher receives ready-to-paste code. Integration takes from a few to a dozen minutes — with no need to plan developer sprints or wait for the IT department.

No Backend Interference

JTag operates exclusively on the user's browser side. The Publisher does not need to modify the server, database, or platform configuration. Editing the HTML template or pasting in the CMS panel is sufficient.

Security and Domain Binding

Every generated code is digitally signed for the Publisher's specific domain. If someone copies the code to another website, the MageAds server will refuse to display ads. This protects the Publisher's account from unauthorized use of their identifiers.

Support for Multiple Ad Placements

A Publisher with multiple ad placements (e.g. top banner, sidebar, footer) receives one shared loader (pasted once on the page) and a short snippet per placement. A pattern familiar from Google AdSense.

No Impact on Page Speed

The code loads asynchronously (the async) — it does not block page rendering and does not affect PageSpeed / Core Web Vitals scores. The loader file is cached in the user's browser with a unique hash, so it only loads once.

Automatic Updates

When MageAds introduces improvements to the display mechanism, the update is automatically delivered to all Publishers without the need for re-integration or contacting the technical team.

Step-by-Step Integration Guide

Step 1 — Configuring a Placement in the MageAds Panel

  • Log in to the MageAds panel.
  • Go to Account, tab Ads Inventory.
  • Create a new placement Add Placement.
  • Configure the placement according to your business requirements.
  • IMPORTANT: when configuring the placement, you must provide the correct main domain of your store, e.g.: www.mystore.com

Step 2 — Copying the Code

  • After successfully creating the placement, in the Placements table, scroll to the right end to the Copy code button and select JS.
  • When you click, the code for that placement will be copied to the clipboard; you can paste it into a text editor to view the contents.

Step 3 — Pasting the Code on the Page

Loader — paste once in the <head> section of your page (or before the closing </body>). One loader handles all ad placements on the page.

Slot — paste where the ad should appear. Each ad placement has its own separate slot.

For WordPress, you can use the WPCode plugin, the "Custom HTML" block in Gutenberg, or the Custom HTML widget.

Step 4 — Verification

After pasting the code, refresh the page in your browser. Ads should appear in the selected locations. If ads do not appear, contact the MageAds team.

Once pasted, the code requires no further maintenance — unless the Publisher wants to add or remove an ad placement.

Code Example

Below is an example page structure with three ad placements:

<!DOCTYPE html>
<html>
<head>
<title>My Store</title>

<!-- Loader: paste once on the page -->
<script async src="https://static.mageads.com/_jtag.js?h=a47590b2"></script>
</head>
<body>
<header>...</header>

<!-- Ad 1: top banner -->
<div data-ma-pc="100" data-sig="..." id="ma-100"></div>

<main>...page content...</main>

<aside>
<!-- Ad 2: sidebar -->
<div data-ma-pc="200" data-sig="..." id="ma-200"></div>
</aside>

<footer>
<!-- Ad 3: footer banner -->
<div data-ma-pc="300" data-sig="..." id="ma-300"></div>
</footer>
</body>
</html>

Code Elements Explained

  • <script src="...">Loader. Downloads the MageAds engine to the user's browser. Pasted once, even with multiple ad placements.
  • <div data-ma-pc="...">Slot. An empty space where the ad will appear. One per placement.
  • data-sig="..."Security signature. Automatically generated in the MageAds panel for a specific (placement, domain) pair. The Publisher receives a ready-made value — no manual calculation required.
  • <div id="ma-<number>">Unique slot identifier.

Supported Placement Types

Placement typeCompatibilityCampaign types
Display✅ YESBanners, Banners with clickable products
Video✅ YESVideo, Video with clickable products
Grid✅ YESGrid of products, video, banners
Product❌ NOSponsored products on listing
Search❌ NOSponsored products based on searched phrases

*Placement types Product and Search require server-to-server integration due to the way product listing or search results are rendered on the page. More information about full integration can be found in our knowledge base.

Example of supported campaigns launched on the MageAds test store: https://shop.mageads.com/jtag-demo/

Frequently Asked Questions

Is a developer needed for integration?

No. Pasting HTML code is as straightforward as editing a blog post or inserting a YouTube embed. Anyone who can edit a page template or CMS panel can do it independently.

Will JTag slow down my page?

No. The async attribute means the MageAds code loads in the background and does not block page content from displaying. The loader file is cached, so after the first load it generates no additional network traffic.

What happens if I change my domain?

You must notify the MageAds team of the domain change. After updating the configuration in the panel, the Publisher will receive new code with new signatures. The old code will automatically stop working on the new domain — which protects against unauthorized use.

My site has both www. and non-www. versions — how do I handle this?

Currently, each domain is configured separately. For scenarios with multiple domain variants (e.g. www.sklep.pl and sklep.pl), please contact the MageAds team to discuss the best approach.

Is JTag blocked by ad blockers?

JTag has been designed to be more resistant to blocking than classic advertising solutions — among other things, it does not use the word "ads" in identifiers visible in the browser. No solution provides a 100% guarantee of ad blocker resistance, but JTag minimizes this risk to the greatest possible extent.

Do I have access to impression and click statistics?

Yes. Statistics for all placements are available in the MageAds panel — identical to the classic integration flow.

The Publisher is responsible for collecting user consent on their site (cookie banner). JTag itself does not set cookies in the browser — the advertising engine downloaded by JTag does so, exclusively within the scope permitted by the consent settings on the Publisher's site, the same as with classic server-to-server integration.

Will my existing integration (PHP / server-side) continue to work?

Yes. Classic server-side integration and JTag work in parallel. Existing clients do not need to change anything. JTag is an additional option — not a replacement.

Troubleshooting

"I pasted the code, but the ad does not appear"

  1. Check the "Domain" field in the MageAds panel. It must exactly match your site's address (note: www. vs non-www., http vs https).
  2. Check whether the Loader is present on the page. In the page source code (View Source), look for <script src=".../_jtag.js">.
  3. Check the placement status in the panel. The placement must have "Active" status.
  4. Check whether active campaigns are assigned to the placement. No active campaign means an empty ad slot — the slot is functional, but there is nothing to display.

"The banner appears in the wrong place on the page"

Make sure each ad div has the id="ma-<number>", e.g.:

<div data-ma-pc="123" data-sig="..." id="ma-123"></div>

If the id attribute is absent, the ad may appear in the wrong place on the page.

Contact Technical Support

For issues not covered by the above guidance, please contact the MageAds team:


Need help? Contact support at info@mageads.com