6.1 KiB
Add a filter to the current report (link below) that lets us view: All, Organic, Advertising, or Campaign. And if Campaign is selected, add a drop down list box with Campaign strings.
https://www.jamkazam.com/admin/admin/jammers_subscription_cohorts
Add a field to the user record in the database that records if a user signup was Organic or Advertising, and if Advertising, add a field to capture/store the Campaign string.
Implement the tech to enable data-driven analysis and advertising optimization for the Meta ad network, as described in the Claude AI notes below. Basically, if we place an ads on Facebook/Instagram/etc, that ad will cause a campaign attribution string to be included in the URL a visitor uses to come to the JamKazam website (typically the Wordpress marketing site). If the user signs up for a JamKazam account, we should tag their account as described above, so that we know this account was generated from Advertising, and from the specific Campaign string in the URL for attribution. Importantly, we should also implement a conversion indicator that reports back to Meta when a user hits the conversion funnel step of Gear Setup (i.e. they have downloaded the desktop app AND then run the FTUE gear setup wizard to set up some gear in the app). We will consider this a “conversion” for the purposes of evaluating and optimizing Meta ads (and Meta will itself use this data to optimize our ROI on ad placements, given that these days AI is being used to make ads more efficient than we can manually accomplish via more traditional targeting methodologies).
Here’s my prompt to Claude: “I'm interested in testing the use of Facebook ads to promote the use of my company's app. It's a desktop app, not a mobile app. It looks like online advertising tech has changed since I last used it, and there is automated optimization for targeting the best prospective users with the best ROI on ad spend. To take advantage of this new optimization, I've read that a good way to use it with an app is to identify a success benchmark and report that benchmark back to the Facebook ads platform for each referred user that "converts" - where converts is defined as hitting that benchmark or milestone. In my case, conversion would equate to having the user download and install the app, and then complete one specified action in the app. This is more complex and time-consuming than, for example, just following an ad link to a particular page, and this process will not live within a single browser session. So I think I would need to somehow call a Facebook Ads API (or something like that) to report back a conversion success on a referred user. To do this, I think I would need some kind of unique ID for each user referred from a Facebook ad, and an understanding of the API (or URL or other tech) used to report this conversion success. Can you please help me by describing how to implement this process technically?”
And below is Claude’s answer:
You're on the right track! What you're describing is Facebook's Conversions API (formerly called Server-Side API), which is designed exactly for this scenario. Here's how to implement it:
Technical Overview Capture Facebook Click ID (fbclid) at Landing
When someone clicks your Facebook ad, Facebook appends a fbclid parameter to the URL (e.g., yoursite.com?fbclid=ABC123). You need to:
Capture this fbclid from the URL when the user lands on your download page
Store it in a cookie or local storage (Facebook recommends a cookie named _fbc with format fb.1.timestamp.fbclid)
Also capture the _fbp cookie (Facebook Pixel browser ID) if you're using the Facebook Pixel
Pass the Click ID Through Your Download Flow
When the user downloads your app installer, you need to pass this tracking data to the app. Common approaches:
URL parameters in download link: Embed the fbclid/fbc in the download URL itself
Server-side tracking: Store the fbclid associated with the download session on your server
Installer metadata: Some installers can accept custom parameters
Store the Click ID in Your App
When your desktop app first runs after installation, capture and store the tracking identifier locally (registry, local file, or app database).
Report Conversion via Conversions API
When the user completes your target action, make an HTTPS POST request to Facebook's Conversions API:
POST https://graph.facebook.com/v18.0/{PIXEL_ID}/events Required parameters:
access_token: Your Conversions API access token
data: JSON array containing event data
Example payload:
json
{ "data": [ { "event_name": "CompleteAction", "event_time": 1702345678, "action_source": "app", "user_data": { "fbc": "fb.1.1702345600.ABC123", "fbp": "fb.1.1702340000.987654321", "em": "hashed_email@example.com", // SHA256 hashed "client_user_agent": "Mozilla/5.0...", "client_ip_address": "192.168.1.1" }, "event_source_url": "https://yoursite.com/download" } ] } Implementation Steps Set up Facebook Pixel on your landing/download page (optional but recommended for attribution)
Get Conversions API credentials from Facebook Business Manager:
Your Pixel ID
Generate an access token with ads_management permission
Capture tracking data on your website:
javascript
// Capture fbclid from URL
const urlParams = new URLSearchParams(window.location.search);
const fbclid = urlParams.get('fbclid');
// Store in cookie for 90 days
if (fbclid) {
const timestamp = Math.floor(Date.now() / 1000);
document.cookie = _fbc=fb.1.${timestamp}.${fbclid}; max-age=7776000; path=/;
}
Associate tracking data with download - perhaps by generating a unique download token that includes the fbc/fbp values
In your desktop app, when the conversion action occurs, make the API call (from your backend server, not directly from the app for security)
Important Considerations Privacy/GDPR: Ensure you have proper consent and privacy policies
Hash PII: Email addresses and phone numbers must be SHA256 hashed
Event deduplication: Use event_id to prevent duplicate reporting
Test events: Use the Test Events feature in Facebook Events Manager during development
Attribution window: Facebook typically has a 7-day click attribution window