{
  "$meta": {
    "package": "@walkeros/web-destination-linkedin",
    "version": "4.2.1",
    "type": "destination",
    "platform": [
      "web"
    ],
    "docs": "https://www.walkeros.io/docs/destinations/web/linkedin",
    "source": "https://github.com/elbwalker/walkerOS/tree/main/packages/web/destinations/linkedin/src"
  },
  "schemas": {
    "mapping": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "conversion": {
          "description": "Resolves to a LinkedIn conversion object with short keys: { id (required number — the Campaign Manager conversion_id), value? (number), currency? (ISO code), eventId? (string for deduplication with a future server/Conversions API destination) }. Events without a resolved id are silently ignored."
        }
      },
      "additionalProperties": false
    },
    "settings": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "apiKey": {
          "type": "string",
          "minLength": 1,
          "pattern": "^\\d+$",
          "description": "Your LinkedIn Partner ID (numeric string, typically 6 to 7 digits). Find it in Campaign Manager under Insight Tag. Assigned to window._linkedin_partner_id before the Insight Tag script loads (like 1234567)."
        }
      },
      "required": [
        "apiKey"
      ],
      "additionalProperties": false
    }
  },
  "examples": {
    "env": {
      "init": {
        "window": {},
        "document": {
          "createElement": {
            "$code": "()=>({src:\"\",async:!1,dataset:{},setAttribute:()=>{},removeAttribute:()=>{}})"
          },
          "head": {
            "appendChild": {
              "$code": "()=>{}"
            }
          },
          "querySelector": {
            "$code": "()=>null"
          }
        }
      },
      "push": {
        "window": {
          "_linkedin_partner_id": "123456",
          "_linkedin_data_partner_ids": [
            "123456"
          ],
          "lintrk": {
            "$code": "()=>{}"
          }
        },
        "document": {
          "createElement": {
            "$code": "()=>({src:\"\",async:!1,dataset:{},setAttribute:()=>{},removeAttribute:()=>{}})"
          },
          "head": {
            "appendChild": {
              "$code": "()=>{}"
            }
          },
          "querySelector": {
            "$code": "()=>null"
          }
        }
      },
      "simulation": [
        "call:window.lintrk"
      ]
    },
    "step": {
      "conversionSilenced": {
        "public": false,
        "in": {
          "name": "form submit",
          "data": {
            "string": "foo",
            "number": 1,
            "boolean": true,
            "array": [
              0,
              "text",
              false
            ]
          },
          "context": {
            "dev": [
              "test",
              1
            ]
          },
          "globals": {
            "lang": "elb"
          },
          "custom": {
            "completely": "random"
          },
          "user": {
            "id": "us3r",
            "device": "c00k13",
            "session": "s3ss10n"
          },
          "nested": [
            {
              "entity": "child",
              "data": {
                "is": "subordinated"
              }
            }
          ],
          "consent": {
            "functional": true
          },
          "id": "00279ed6d94fe470",
          "trigger": "test",
          "entity": "form",
          "action": "submit",
          "timestamp": 1700000105,
          "timing": 3.14,
          "source": {
            "count": 1,
            "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
            "type": "collector",
            "schema": "4"
          }
        },
        "mapping": {
          "silent": true,
          "settings": {
            "conversion": {
              "map": {
                "id": {
                  "value": 12345
                }
              }
            }
          }
        },
        "out": []
      },
      "demoRequestLead": {
        "title": "Lead conversion",
        "description": "A demo request fires a LinkedIn lintrk track for a lead conversion with id and event_id only.",
        "in": {
          "name": "demo request",
          "data": {
            "string": "foo",
            "number": 1,
            "boolean": true,
            "array": [
              0,
              "text",
              false
            ]
          },
          "context": {
            "dev": [
              "test",
              1
            ]
          },
          "globals": {
            "lang": "elb"
          },
          "custom": {
            "completely": "random"
          },
          "user": {
            "id": "us3r",
            "device": "c00k13",
            "session": "s3ss10n"
          },
          "nested": [
            {
              "entity": "child",
              "data": {
                "is": "subordinated"
              }
            }
          ],
          "consent": {
            "functional": true
          },
          "id": "1700000104abcdef",
          "trigger": "test",
          "entity": "demo",
          "action": "request",
          "timestamp": 1700000104,
          "timing": 3.14,
          "source": {
            "count": 1,
            "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
            "type": "collector",
            "schema": "4"
          }
        },
        "mapping": {
          "settings": {
            "conversion": {
              "map": {
                "id": {
                  "value": 44444
                },
                "eventId": "id"
              }
            }
          }
        },
        "out": [
          [
            "lintrk",
            "track",
            {
              "conversion_id": 44444,
              "event_id": "1700000104abcdef"
            }
          ]
        ]
      },
      "missingConversionIdIgnored": {
        "public": false,
        "in": {
          "name": "form submit",
          "data": {
            "string": "foo",
            "number": 1,
            "boolean": true,
            "array": [
              0,
              "text",
              false
            ]
          },
          "context": {
            "dev": [
              "test",
              1
            ]
          },
          "globals": {
            "lang": "elb"
          },
          "custom": {
            "completely": "random"
          },
          "user": {
            "id": "us3r",
            "device": "c00k13",
            "session": "s3ss10n"
          },
          "nested": [
            {
              "entity": "child",
              "data": {
                "is": "subordinated"
              }
            }
          ],
          "consent": {
            "functional": true
          },
          "id": "bbc922c35f639332",
          "trigger": "test",
          "entity": "form",
          "action": "submit",
          "timestamp": 1700000106,
          "timing": 3.14,
          "source": {
            "count": 1,
            "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
            "type": "collector",
            "schema": "4"
          }
        },
        "mapping": {
          "settings": {
            "conversion": {
              "map": {
                "id": "data.nonexistentField"
              }
            }
          }
        },
        "out": []
      },
      "orderCompleteFullConversion": {
        "title": "Ecommerce conversion",
        "description": "A completed order fires a LinkedIn lintrk track with conversion_id, value, currency, and event_id for deduplication.",
        "in": {
          "name": "order complete",
          "data": {
            "id": "0rd3r1d",
            "currency": "EUR",
            "shipping": 5.22,
            "taxes": 73.76,
            "total": 555
          },
          "context": {
            "shopping": [
              "complete",
              0
            ]
          },
          "globals": {
            "pagegroup": "shop"
          },
          "custom": {
            "completely": "random"
          },
          "user": {
            "id": "us3r",
            "device": "c00k13",
            "session": "s3ss10n"
          },
          "nested": [
            {
              "entity": "product",
              "data": {
                "id": "ers",
                "name": "Everyday Ruck Snack",
                "color": "black",
                "size": "l",
                "price": 420
              },
              "context": {
                "shopping": [
                  "complete",
                  0
                ]
              },
              "nested": []
            },
            {
              "entity": "product",
              "data": {
                "id": "cc",
                "name": "Cool Cap",
                "size": "one size",
                "price": 42
              },
              "context": {
                "shopping": [
                  "complete",
                  0
                ]
              },
              "nested": []
            },
            {
              "entity": "gift",
              "data": {
                "name": "Surprise"
              },
              "context": {
                "shopping": [
                  "complete",
                  0
                ]
              },
              "nested": []
            }
          ],
          "consent": {
            "functional": true
          },
          "id": "1700000102abcdef",
          "trigger": "load",
          "entity": "order",
          "action": "complete",
          "timestamp": 1700000102,
          "timing": 3.14,
          "source": {
            "count": 1,
            "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
            "type": "collector",
            "schema": "4"
          }
        },
        "mapping": {
          "settings": {
            "conversion": {
              "map": {
                "id": {
                  "value": 67890
                },
                "value": "data.total",
                "currency": {
                  "key": "data.currency",
                  "value": "EUR"
                },
                "eventId": "id"
              }
            }
          }
        },
        "out": [
          [
            "lintrk",
            "track",
            {
              "conversion_id": 67890,
              "conversion_value": 555,
              "currency": "EUR",
              "event_id": "1700000102abcdef"
            }
          ]
        ]
      },
      "pageViewConversion": {
        "title": "Key page view",
        "description": "A page view fires an explicit lintrk track mapped to a LinkedIn KEY_PAGE_VIEW conversion rule.",
        "in": {
          "name": "page view",
          "data": {
            "domain": "www.example.com",
            "title": "walkerOS documentation",
            "referrer": "https://www.walkeros.io/",
            "search": "?foo=bar",
            "hash": "#hash",
            "id": "/docs/"
          },
          "context": {
            "dev": [
              "test",
              1
            ]
          },
          "globals": {
            "pagegroup": "docs"
          },
          "custom": {
            "completely": "random"
          },
          "user": {
            "id": "us3r",
            "device": "c00k13",
            "session": "s3ss10n"
          },
          "nested": [
            {
              "entity": "child",
              "data": {
                "is": "subordinated"
              }
            }
          ],
          "consent": {
            "functional": true
          },
          "id": "1700000103abcdef",
          "trigger": "load",
          "entity": "page",
          "action": "view",
          "timestamp": 1700000103,
          "timing": 3.14,
          "source": {
            "count": 1,
            "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
            "type": "collector",
            "schema": "4"
          }
        },
        "mapping": {
          "settings": {
            "conversion": {
              "map": {
                "id": {
                  "value": 11111
                },
                "eventId": "id"
              }
            }
          }
        },
        "out": [
          [
            "lintrk",
            "track",
            {
              "conversion_id": 11111,
              "event_id": "1700000103abcdef"
            }
          ]
        ]
      },
      "partialFieldsOmitted": {
        "public": false,
        "in": {
          "name": "order complete",
          "data": {
            "id": "0rd3r1d",
            "currency": "EUR",
            "shipping": 5.22,
            "taxes": 73.76,
            "total": 555
          },
          "context": {
            "shopping": [
              "complete",
              0
            ]
          },
          "globals": {
            "pagegroup": "shop"
          },
          "custom": {
            "completely": "random"
          },
          "user": {
            "id": "us3r",
            "device": "c00k13",
            "session": "s3ss10n"
          },
          "nested": [
            {
              "entity": "product",
              "data": {
                "id": "ers",
                "name": "Everyday Ruck Snack",
                "color": "black",
                "size": "l",
                "price": 420
              },
              "context": {
                "shopping": [
                  "complete",
                  0
                ]
              },
              "nested": []
            },
            {
              "entity": "product",
              "data": {
                "id": "cc",
                "name": "Cool Cap",
                "size": "one size",
                "price": 42
              },
              "context": {
                "shopping": [
                  "complete",
                  0
                ]
              },
              "nested": []
            },
            {
              "entity": "gift",
              "data": {
                "name": "Surprise"
              },
              "context": {
                "shopping": [
                  "complete",
                  0
                ]
              },
              "nested": []
            }
          ],
          "consent": {
            "functional": true
          },
          "id": "1700000107abcdef",
          "trigger": "load",
          "entity": "order",
          "action": "complete",
          "timestamp": 1700000107,
          "timing": 3.14,
          "source": {
            "count": 1,
            "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
            "type": "collector",
            "schema": "4"
          }
        },
        "mapping": {
          "settings": {
            "conversion": {
              "map": {
                "id": {
                  "value": 67890
                },
                "value": "data.missingTotal",
                "eventId": "id"
              }
            }
          }
        },
        "out": [
          [
            "lintrk",
            "track",
            {
              "conversion_id": 67890,
              "event_id": "1700000107abcdef"
            }
          ]
        ]
      },
      "simpleConversionId": {
        "title": "Simple conversion",
        "description": "A form submit fires a LinkedIn lintrk track with only a conversion_id from Campaign Manager.",
        "in": {
          "name": "form submit",
          "data": {
            "string": "foo",
            "number": 1,
            "boolean": true,
            "array": [
              0,
              "text",
              false
            ]
          },
          "context": {
            "dev": [
              "test",
              1
            ]
          },
          "globals": {
            "lang": "elb"
          },
          "custom": {
            "completely": "random"
          },
          "user": {
            "id": "us3r",
            "device": "c00k13",
            "session": "s3ss10n"
          },
          "nested": [
            {
              "entity": "child",
              "data": {
                "is": "subordinated"
              }
            }
          ],
          "consent": {
            "functional": true
          },
          "id": "e4972543b072a0a7",
          "trigger": "test",
          "entity": "form",
          "action": "submit",
          "timestamp": 1700000101,
          "timing": 3.14,
          "source": {
            "count": 1,
            "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
            "type": "collector",
            "schema": "4"
          }
        },
        "mapping": {
          "settings": {
            "conversion": {
              "map": {
                "id": {
                  "value": 12345
                }
              }
            }
          }
        },
        "out": [
          [
            "lintrk",
            "track",
            {
              "conversion_id": 12345
            }
          ]
        ]
      },
      "unmappedEventIgnored": {
        "public": false,
        "in": {
          "name": "product view",
          "data": {
            "id": "ers",
            "name": "Everyday Ruck Snack",
            "color": "black",
            "size": "l",
            "price": 420
          },
          "context": {
            "shopping": [
              "detail",
              0
            ]
          },
          "globals": {
            "pagegroup": "shop"
          },
          "custom": {
            "completely": "random"
          },
          "user": {
            "id": "us3r",
            "device": "c00k13",
            "session": "s3ss10n"
          },
          "nested": [],
          "consent": {
            "functional": true
          },
          "id": "05ce1adb6a00daae",
          "trigger": "load",
          "entity": "product",
          "action": "view",
          "timestamp": 1700000100,
          "timing": 3.14,
          "source": {
            "count": 1,
            "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
            "type": "collector",
            "schema": "4"
          }
        },
        "out": []
      }
    }
  }
}