MAJC is a small, reusable JavaScript component that requests and displays ads from Mozilla’s servers. It is designed for use on HTML surfaces that display sponsored content, like Mozilla web properties or the Firefox New Tab page.
MAJC is privacy-first. It does not track users nor store cookies. It does not send sensitive identifiable information to Mozilla. Of the information Mozilla does receive, anything shared with advertisers is aggregated and/or de-identified to preserve user privacy.
MAJC can request and display standard ad placements, and calls the appropriate callback URLs to send anonymized impressions and clicks back to Mozilla. MAJC also provides a facility to report user dissatisfaction with ads so we can take appropriate action as necessary.
While we welcome outside feedback and are committed to open source, this library is intended solely for use on Mozilla properties.
This project and repository is governed by Mozilla's code of conduct and etiquette guidelines. Please see the CODE_OF_CONDUCT.md file for more details.
This repository is licensed under MPL-2.0. Please see the LICENSE file for more details.
In your project's repository:
npm install --save git+https://github.com/mozilla-services/majc.git
Or, add this repository's Git URL to your project's dependencies in package.json
:
"dependencies": {
"@mozilla-services/majc": "git+https://github.com/mozilla-services/majc.git"
}
Depending on your project's setup, this package may be included in several different ways.
For webpages that want to simply include a <script>
tag:
<script src="iife.global.js"></script>
The iife.global.js
bundle may be found in this repo's ./dist
folder. This bundle exposes a single mozAds
global containing the renderPlacement
function as well as some useful constants such as standard IAB placement size definitions. Please see the example in ./examples/iife
for usage.
React apps can import the react
bundle from this repo's ./dist
folder. This bundle is available in both CJS and ESM formats and also includes TypeScript type definitions. The primary export from this bundle is the MozAdsPlacement
component. To import in a TypeScript React app:
import { MozAdsPlacement } from '@mozilla-services/majc/dist/react'
This bundle exports a React component and hooks for inclusion in a React app. Please see the example in ./examples/react
for usage.