Upload and clear the traffic-source names that show in Reporting. Written through this Ledger (Assets) API, not the Reporting API.
Upload manual name mappings for a traffic source field
Merges ID-to-name rows into the traffic source's manual names for one field (campaign, field1 or field2). A row whose ID already has a manual name replaces it; every other stored name is kept. The field must be declared in the traffic source's dataMapping, and the traffic source must not get its names from dictionary sync.
Limits: at most 10,000 rows per request and a request body of at most 4 MiB (4,194,304 bytes). Larger uploads must be split. A body over 4 MiB sent through the API gateway is refused by the gateway itself with a plain-text HTTP 400 ("Error when parsing request"), not the JSON error below.
Each ID and name is trimmed of surrounding whitespace, must then be 1 to 512 characters, and must not contain control or format characters. IDs are compared without regard to letter case: rows with the same ID and the same name collapse into one, rows with the same ID and different names are all refused as duplicate_id_conflict. The upload is all-or-nothing for row validation: if any row is refused, nothing is stored and the response lists every refused row in rowErrors.
Checks run in this order and the first to fail answers: body size (413), request shape (400 invalid_request), traffic source exists and is not deleted (404), dictionary sync is off (409 dictionary_sync_enabled), field is declared (409 field_not_declared), row count (400 no_rows / too_many_rows), row contents (400 invalid_rows).
Upload manual name mappings for a traffic source field › Request Body
idTrafficSourcefieldRows to merge. rowErrors[].row in an error response is the 1-based position in this array.
Upload manual name mappings for a traffic source field › Responses
Rows merged
idTrafficSourcefieldaddedRows whose ID had no manual name before.
updatedRows whose ID already had a manual name, which was replaced.
Clear manual name mappings of a traffic source
Removes manual names of one traffic source. With field, only that field's manual names are removed. Without field (or with field empty), every manual name of that traffic source is removed, across campaign, field1 and field2, declared or not. A clear never reaches more than one traffic source: other traffic sources of the account and other accounts' names are untouched. Names synced from an integration are never touched. The field does not need to be declared, so names left behind by an undeclared field can be removed. Clearing a field, or a source, with no stored names succeeds with removed 0. A field outside campaign/field1/field2 is refused with 400 invalid_request and nothing is cleared. Because an omitted field clears all fields, the body may hold only idTrafficSource and field, spelled exactly so and each at most once: any other key (such as a misspelled feild or Field in another letter case), a repeated key, and an explicit "field": null are refused with 400 invalid_request and nothing is cleared.
Returns 404 for a missing or deleted traffic source and 409 dictionary_sync_enabled when the traffic source gets its names from dictionary sync.
Clear manual name mappings of a traffic source › Request Body
idTrafficSourcefieldField to clear. Omit it, or send it empty, to clear every manual name of that one traffic source: campaign, field1 and field2, declared or not. A clear never reaches another traffic source, another account, or names synced from an integration. null is refused with 400; omit the key instead.
Clear manual name mappings of a traffic source › Responses
Names removed
idTrafficSourceremovedNumber of manual names removed.