
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
The MA agent collects data to evaluate the effectiveness of advertising.
npm i ma-agent
es modules
import { agentInit } from '@kosmos/ma-agent';
agentInit({
defaultData: {client_version: '<client version>'},
url: '<url>',
token: '<token>'
});
From bundle
<script src="./dist/bundle.umd.js"></script>
<script type="text/javascript">
maAgent.agentInit({
defaultData: {client_version: '<client version>'},
url: '<url>',
token: '<token>'
});
</script>
After initialization, you will have objects
window.mAgent - Analytics
window.kBanner - Cross reference banners
After the download of your game is complete.
!!important!! This function should be called after FBInstant.initializeAsync()
import { EventTypes } from '@kosmos/ma-agent';
window.mAgent
.sendEvent({
user_id: '<user_id|social_id>', // the user ID on the server or the id that was issued by the platform
data: {
social_id: '<social_id>', //the ID provided by the platform
is_install: 1 // if this is a new user in the game
},
event_type: EventTypes.visit //2
});
After Transaction is complete
import { EventTypes } from '@kosmos/ma-agent';
window.mAgent
.sendEvent({
user_id: '<user_id|social_id: string>', // the user ID on the server or the id that was issued by the platform <string>
data: {
social_id: '<social_id: string>', // the ID provided by the platform
transaction_id: 'transaction123', // transaction ID provided by the platform
price: 10000.0, // purchaise price
proceed: 1000, // total income from the purchase without platform fees and local tax
currency: 'USD' // currency code
},
event_type: EventTypes.transaction // 1
});
Client Transaction
import { EventTypes } from '@kosmos/ma-agent';
window.mAgent
.sendEvent({
user_id: '<user_id|social_id: string>', // the user ID on the server or the id that was issued by the platform <string>
data: {
social_id: '<social_id: string>', // the ID provided by the platform
transaction_id: 'transaction123', // transaction ID provided by the platform
price: 10000.0, // <optional> purchaise price
currency: 'USD', // <optional> currency code
purchase_platform: 'GOOGLE' // purchase_platform in fb receipt (string)
},
event_type: EventTypes.raw_transaction // 5
});
After the ad is shown
import { EventTypes } from '@kosmos/ma-agent';
window.mAgent
.sendEvent({
user_id: '<user_id|social_id: string>', // the user ID on the server or the id that was issued by the platform
data: {
ad_type: 'Interstitial|rewarded|...',
revenue: 0.5, // total income from the ad shown without platform fees and local tax
currency: 'USD', // currency code
count: 1, // Number of ad impressions
client_platform: 1,
},
event_type: EventTypes.ad_shown // 3
});
After the banner click / sown
window.kBanner
.emit({
user_id: '<inside user id>: string', // <optional>
social_id: '<social_id>: string',
case_id: 1,
content_type: 'crossBanner',
redirect_game_id: 'string', // name of the target game
banner_id: 'default', // custom ID for easy search
action: 'shown'|'click'
});
It is important that errors in the application do not interfere with sending the event.
Events that your server can send, such as rawTransactions|Transaction, were sent by the server after they were confirmed.
FAQs
The MA agent collects data to evaluate the effectiveness of advertising.
We found that ma-agent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.