agentleFS
itsryanarmaniitsryanarmani/skills/ads-linkedin/SKILL.md

ads-linkedin

Skill1 starsChanged 5 days agoMITView on GitHub

Set up LinkedIn Ads with a self-serve Campaign Manager account, the Insight Tag, and LinkedIn Conversions API — including direct non-expiring token access, approved partner OAuth, SHA-256 email matching, li_fat_id capture, eventId deduplication, conversion-rule settings, and Campaign Manager verification. Use when wiring LinkedIn signup, lead, checkout, purchase, or subscription tracking, fixing low match rates, or launching a B2B paid test.

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ads-apple, ads-dna and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • chriswesttSkill

    ads-apple

    Apple Ads (formerly Apple Search Ads) deep analysis for mobile app advertisers. Evaluates campaign structure, bid health, Custom Product Pages (CPPs), MMP attribution, budget pacing, TAP coverage (Today/Search/Product Pages), Maximize Conversions bidding, and goal CPA benchmarks by country. Use when user says Apple Ads, Apple Search Ads, ASA, App Store ads, Apple ads, Search Ads, or is advertising a mobile app on iOS.

    Also in 5 projects that use this

  • chriswesttSkill

    ads-dna

    Brand DNA extractor for paid advertising. Scans a website URL to extract visual identity, tone of voice, color palette, typography, and imagery style. Outputs brand-profile.json to the current directory. Run before /ads create or /ads generate for brand-consistent creative. Triggers on: brand DNA, brand profile, extract brand, brand identity, brand colors, what is the brand voice, analyze brand, brand style guide.

    Also in 5 projects that use this

  • OpenAISkill

    gsap

    GSAP animation reference for HyperFrames. Covers gsap.to(), from(), fromTo(), easing, stagger, defaults, timelines (gsap.timeline(), position parameter, labels, nesting, playback), and performance (transforms, will-change, quickTo). Use when writing GSAP animations in HyperFrames compositions.

    Also in 3 projects that use this

  • OpenAISkill

    hyperframes-cli

    HyperFrames CLI tool — hyperframes init, lint, inspect, preview, render, transcribe, tts, doctor, browser, info, upgrade, compositions, docs, benchmark. Use when scaffolding a project, linting, validating, inspecting visual layout in compositions, previewing in the studio, rendering to video, transcribing audio, generating TTS, or troubleshooting the HyperFrames environment.

    Also in 3 projects that use this

  • StrayDragonSkill

    ui-ux-pro-max

    UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.

    Also in 3 projects that use this

  • +2 more from chriswestt

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 8 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use ad-conversion-hub for the canonical event envelope, consent gate, identity rules, retry policy, and adapter contract.

    line 11
  2. Very specific:

    Create the tag under Data → Signals Manager → Insight Tag.

    line 43
  3. Distinctive:

    Create a CAPI rule:

    line 103
  4. Distinctive:

    Remove email whitespace, lowercase it, then SHA-256 hash it.

    line 161
  5. Distinctive:

    Create a browser Insight Tag rule and a server CAPI rule for the action.

    line 191
  6. Very specific:

    Put the same hub event_id in browser event_id and server eventId.

    line 192
  7. Distinctive:

    Check both conversion breakdowns.

    line 195
  8. Distinctive:

    No campaign association means no campaign attribution.

    line 204
  9. Very specific:

    Use urn:li:sponsoredAccount:<id> for the account and urn:lla:llaPartnerConversion:<id> for the rule.

    line 230
  10. Very specific:

    Use epoch milliseconds, not seconds.

    line 232
  11. Distinctive:

    Do not send raw email, an uppercase hash, or a double-hashed email.

    line 233
  12. Distinctive:

    Do not create a new browser and server ID for one event.

    line 234
  13. Very specific:

    Do not send only li_fat_id.

    line 235
  14. Very specific:

    Do not treat 201, a live tag request, or an active campaign as attribution.

    line 236
  15. Very specific:

    Keep LINKEDIN_CAPI_TOKEN server-side.

    line 239

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

LinkedIn Ads

LinkedIn Ads has a self-serve ad account and a real Conversions API. Create and associate a conversion rule, then send confirmed events.

Use ad-conversion-hub for the canonical event envelope, consent gate, identity rules, retry policy, and adapter contract.

Account and access

Campaign Manager is self-serve. Select For Business → Advertise in LinkedIn, then create an ad account. A Business Manager account requires an admin. The creator gets account manager and billing admin access. Currency and Company Page cannot change later; a Company Page is required for full features. See Create an ad account.

For a direct advertiser integration, use Data → Signals Manager → Direct API → Generate access token. This route needs no developer application. The token does not expire and appears once. Store it at once. See CAPI access.

For a product serving several advertisers, request the Conversions API product for a developer app. LinkedIn reviews the business details and use case. A Page super admin must verify the app. Partner OAuth uses rw_conversions and r_ads; the member needs a non-VIEWER role. See partner access and the API workflow.

LinkedIn defines no environment-variable names. This skill uses the hub convention:

LINKEDIN_TAG_ID                public Insight Tag partner ID
LINKEDIN_ACCOUNT_URN           urn:li:sponsoredAccount:<id>
LINKEDIN_CAPI_TOKEN             server-only direct or OAuth bearer token
LINKEDIN_CAPI_CONVERSION_URN    urn:lla:llaPartnerConversion:<id>
LINKEDIN_INSIGHT_CONVERSION_ID  browser conversion rule ID
LINKEDIN_VERSION                value for the Linkedin-Version header

Client-side Insight Tag

Create the tag under Data → Signals Manager → Insight Tag. Copy its partner ID. Load it on every eligible page in the global footer, just before </body>. See Insight Tag conversion tracking.

<script type="text/javascript">
  _linkedin_partner_id = "<LINKEDIN_TAG_ID>";
  window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
  window._linkedin_data_partner_ids.push(_linkedin_partner_id);
</script>
<script type="text/javascript">
  (function (l) {
    if (!l) {
      window.lintrk = function (a, b) { window.lintrk.q.push([a, b]); };
      window.lintrk.q = [];
    }
    var s = document.getElementsByTagName("script")[0];
    var b = document.createElement("script");
    b.type = "text/javascript"; b.async = true;
    b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";
    s.parentNode.insertBefore(b, s);
  })(window.lintrk);
</script>
<noscript><img height="1" width="1" style="display:none" alt=""
  src="https://px.ads.linkedin.com/collect/?pid=<LINKEDIN_TAG_ID>&fmt=gif" /></noscript>

For a page-load conversion, set the shared ID before the base tag:

<script>window._linkedin_event_id = "<CANONICAL_EVENT_ID>";</script>

For an event-specific conversion, pass the same ID to lintrk:

window.lintrk("track", {
  conversion_id: "<LINKEDIN_INSIGHT_CONVERSION_ID>",
  event_id: canonicalEvent.event_id,
});

Rule setup and event mapping

The streaming payload has no free-form event name. The conversion rule's type supplies the LinkedIn event name. Create a rule per type. Use separate browser and server rules when you enable deduplication.

Hub eventLinkedIn rule typeSend when
page_viewKEY_PAGE_VIEWImportant page only
view_contentVIEW_CONTENTMeaningful product or plan view
leadLEADQualified lead submission
signupSIGN_UP or COMPLETE_SIGNUPAccount or registration completes
begin_checkoutSTART_CHECKOUTCheckout starts
purchasePURCHASEPayment provider confirms a charge
subscription_startSUBSCRIBEPaid subscription activates
refundDo not dispatchReconcile with payment truth

These types are in the CAPI schema. LinkedIn documents no REFUND type.

Create a CAPI rule:

POST https://api.linkedin.com/rest/conversions?autoAssociationType=ALL_CAMPAIGNS
Authorization: Bearer <LINKEDIN_CAPI_TOKEN>
Content-Type: application/json
Linkedin-Version: <LINKEDIN_VERSION>
X-Restli-Protocol-Version: 2.0.0
{
  "name": "CAPI purchase",
  "account": "urn:li:sponsoredAccount:<ACCOUNT_ID>",
  "conversionMethod": "CONVERSIONS_API",
  "postClickAttributionWindowSize": 90,
  "viewThroughAttributionWindowSize": 30,
  "attributionType": "LAST_TOUCH_BY_CAMPAIGN",
  "type": "PURCHASE"
}

Save the returned ID as urn:lla:llaPartnerConversion:<id>. Without automatic association, use the Campaign Conversions API or Campaign Manager UI. LinkedIn only attributes to associated campaigns. See Conversions API.

Server-side Conversions API

Send the confirmed event to POST https://api.linkedin.com/rest/conversionEvents with the same bearer and version headers above:

{
  "conversion": "urn:lla:llaPartnerConversion:<CONVERSION_ID>",
  "conversionHappenedAt": 1730017211229,
  "conversionValue": { "currencyCode": "USD", "amount": "25.00" },
  "user": { "userIds": [
    { "idType": "SHA256_EMAIL", "idValue": "<SHA256_EMAIL_HEX>" },
    { "idType": "LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID", "idValue": "<LI_FAT_ID>" }
  ]},
  "eventId": "<CANONICAL_EVENT_ID>"
}

conversion, conversionHappenedAt, and user are the event fields. The timestamp is epoch milliseconds and must be within 90 days. The value amount is a decimal string. At least one valid identity is required unless another valid user field supplies identity. A successful single event returns 201 Created. See the event schema.

Batch requests use X-RestLi-Method: BATCH_CREATE and allow 5,000 events. Use the hub's bounded retry and dead-letter policy. Do not replay an uncertain request unless the dispatch record and eventId rule make it safe. See CAPI FAQ.

Identity and consent

  • Require measurement: true in the hub before any LinkedIn event.
  • Require ad_user_data: true before hashed email, IP, or external IDs.
  • Remove email whitespace, lowercase it, then SHA-256 hash it. Send lowercase hexadecimal text. Do not hash an existing hash again.
  • Supported IDs include SHA256_EMAIL, LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID, ACXIOM_ID, PLAINTEXT_IP_ADDRESS, SHA256_IP_ADDRESS, and GOOGLE_AID.
  • Plain and hashed IP IDs support IPv4 only. userInfo is plain text and needs both firstName and lastName. externalIds accepts one advertiser ID.
  • LinkedIn preserves a matched external-ID mapping for one year across ad accounts in the same Business Manager. Pair it with a standard ID first.

The hub owns normalization and consent. LinkedIn also prohibits the Insight Tag on pages that collect sensitive health or financial data. See privacy guidance.

Click ID and first-party cookie

Enable Enhanced conversion tracking for the Insight Tag. LinkedIn then adds li_fat_id to ad landing URLs. Capture it on first landing and persist first- touch and latest values in first-party storage. The cookie lasts 30 days from the latest qualifying ad click. Send it to CAPI as LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID. Parsing only the URL can limit view- through attribution; reading the cookie supports it. Do not require a click ID before sending a server purchase. See Enabling Click IDs.

New tags enable first-party tracking by default. Check firstPartyTrackingEnabled when the cookie or li_fat_id is absent. Campaign Manager and the partial update API can change this setting.

Deduplication

LinkedIn reconciles browser and server copies with eventId.

  1. Create a browser Insight Tag rule and a server CAPI rule for the action.
  2. Put the same hub event_id in browser event_id and server eventId.
  3. Set _linkedin_event_id before the page-load tag, or pass event_id to lintrk for an event-specific conversion.
  4. Check both conversion breakdowns. For the same account and ID, LinkedIn counts the Insight Tag copy and discards the CAPI twin.

See LinkedIn deduplication. The event ID is not the conversion rule URN.

Campaign Manager settings that override code

  • enabled=false stops a rule from matching events.
  • conversionMethod must be CONVERSIONS_API for server rules.
  • No campaign association means no campaign attribution.
  • The rule controls attribution windows and model. Current CAPI defaults are 30 days post-click and 7 days view-through. Supported windows include 1, 7, 30, and 90 days; 365 days is limited to some types.
  • DYNAMIC, FIXED, and NO_VALUE control reported conversion value.
  • A blocked Insight Tag domain sends no downstream conversion or audience signal.
  • Website Actions can create conversions that stay inactive until approved.

See rule settings and Website Actions.

Verification

  1. Request proof: record the redacted event response. 201 Created proves request acceptance, not attribution.
  2. Platform proof: in Campaign Manager, open Measurement → Conversion Tracking. Check the CAPI rule status and match rate. Active with a good match rate shows receipt and identity matching. Low Match Rate shows poor identity matching. Read active CAPI rules with GET /rest/conversions, filtering enabled=true and conversionMethod=CONVERSIONS_API.
  3. Business proof: open Conversions & Leads, break down by conversion, and reconcile counts and value with succeeded charges.

For the tag, query GET https://api.linkedin.com/rest/insightTagDomains?q=account&account=<ENCODED_ACCOUNT_URN>. Domains can take 5–10 minutes to populate after a visit. See tag verification and CAPI measurement.

Common pitfalls and security

  • Use urn:li:sponsoredAccount:<id> for the account and urn:lla:llaPartnerConversion:<id> for the rule.
  • Use epoch milliseconds, not seconds. Use eventId, not event_id, in CAPI.
  • Do not send raw email, an uppercase hash, or a double-hashed email.
  • Do not create a new browser and server ID for one event.
  • Do not send only li_fat_id; organic and direct events still matter.
  • Do not treat 201, a live tag request, or an active campaign as attribution.
  • Recheck rule status, domain status, campaign association, member role, and rw_conversions/r_ads after any access change.
  • Keep LINKEDIN_CAPI_TOKEN server-side. Never put it in browser code, URLs, logs, screenshots, or commits. Use HTTPS, redact bearer tokens, apply the hub consent gate, and delete temporary normalized identifiers after dispatch.

Official sources checked (2026-08-28)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.