Meta Event Manager Configurations: #
- Login to your Meta event manager.
- Click “Connect Data” to connect a new data source.

- Choose the “Web” option.
- Create or select your existing dataset (If you have created a pixel already).

- If you choose to create a new dataset, define a name first.

- Choose “Setup manually” to Install the code to your landing page.
- Choose “Meta Pixel only” option.
- Then you will be redirected to the Pixel installation page, as shown below:
- Follow each step, just click “Continue” (no need to Install the code now), then you will find your Pixel created with ID listed as below:

- You can then generate your access token under the “Settings” tab, as shown below:

- After you click “Generate Access Token”, you will see your token as shown below.

Please save your Pixel ID and access token for further configuration.
Landing page code installation #
- Follow our sample code and simply replace the Pixel ID with your own. Please include the Meta Pixel code in the <head> section, and update 670376802193803 to your own Pixel ID.
JavaScript
<head>
<!-- Meta Pixel Code -->
<script>
!(function (f, b, e, v, n, t, s) {
if (f.fbq) return;
n = f.fbq = function () {
n.callMethod
? n.callMethod.apply(n, arguments)
: n.queue.push(arguments);
};
if (!f._fbq) f._fbq = n;
n.push = n;
n.loaded = !0;
n.version = "2.0";
n.queue = [];
t = b.createElement(e);
t.async = !0;
t.src = v;
s = b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s);
})(
window,
document,
"script",
"https://connect.facebook.net/en_US/fbevents.js"
);
fbq("init", "670376802193803");
fbq("track", "PageView");
</script>
<noscript>
<img
height="1"
width="1"
style="display: none"
src="https://www.facebook.com/tr?id=670376802193803&ev=PageView&noscript=1"
/>
</noscript>
<!-- End Meta Pixel Code -->
</head>Please include below part in the body of your html, you can edit accordingly if needed
JavaScript
<script>
// Capture URL Parameters
const urlParams = new URLSearchParams(window.location.search);
let fbclid = urlParams.get("fbclid") || "";
let fbpid = getFbPid();
let campaign_id = urlParams.get("campaign_id") || "";
let campaign_name = urlParams.get("campaign_name") || "";
let creative_name = urlParams.get("creative_name") || "";
// Function to Get Facebook Pixel ID from Cookies
function getFbPid() {
let fbPidMatch = document.cookie.match(/(^|;) ?_fbp=([^;]*)(;|$)/);
return fbPidMatch ? fbPidMatch[2] : null;
}
// Function to Handle Download Button Click
function handleDownloadClick() {
let trackingURL = `https://track.tenjin.com/v0/metapixel/bFpF2uljcAyfPCzwUJ0tuZ?campaign_id=${campaign_id}&campaign_name=${campaign_name}&creative_name=${creative_name}&tenjin_parameter_0=${fbpid}&tenjin_parameter_1=${fbclid}&bundle_id=com.tenjin.wordsearch&platform=ios`;
let downloadURL = "https://kudoocat.com/puzzlegame.apk";
// Step 1: Send tracking request silently (NO page redirection)
fetch(trackingURL, { method: "GET", mode: "no-cors" })
.then(() => {
console.log("Tracking sent successfully.");
})
.catch(() => {
console.log("Tracking request failed.");
});
// Step 2: Directly trigger file download
window.location.href = downloadURL;
}
// Prevent iOS Double-Tap Zoom
let lastTouchEnd = 0;
document.addEventListener('touchend', function(event) {
const now = Date.now();
if (now - lastTouchEnd <= 300) {
event.preventDefault();
}
lastTouchEnd = now;
}, false);
// Prevent Multi-Touch Gestures
document.addEventListener('touchstart', function(e) {
if (e.touches.length > 1) {
e.preventDefault();
}
}, { passive: false });
</script>For the tracking URL part, please get your own tracking url from Tenjin (refer to Tenjin setup instruction as below).
Configuration on Tenjin dashboard: #
- Add Meta Web-to-App channel to Tenjin.
- Create a campaign in the campaigns page and copy the tracking link as below. bFpF2uljcAyfPCzwUJ0tuZ in the URL will be a unique ID for your Tenjin account.
- Turn on the Meta Web-to-App Callback:
- Meta Web to App IAP
- Meta Web to App Install (optional)
- Meta Web to App Custom Event (optional)
Meta Ads Manager: #
- Choose a “Sales” objective when you create a campaign on Meta Ads Manager.
- At the ad-set level, please choose “Conversion” → “Website”.

- In the ad level, select your pixel you created under the “Tracking” part.

- Click “Build a URL parameter” link, and follow the setup below to add campaign_id, campaign_name and creative_name mapped to proper params as shown below:

- Please make sure you have already triggered the event to Pixel after all above configuration is completed, you can verify if you have received those events under “Datasets” -> “Overview” in the Meta event manager.







