Description
Truncate supplied ad copy to a code-point budget with a chosen ellipsis.
Advertising records distinguish nominal reach, impressions, visibility thresholds, disclosure order and content budgets. New unique people are supplied rather than deduplicated, and caption duration alone does not establish accessibility. Code-point truncation can split a grapheme even when it meets a numeric text budget.
Truncate supplied ad copy to a code-point budget with a chosen ellipsis.
When to use this tool
Use Ad Copy Truncation Ellipsis Budget when you already have copyText, maximumCodePoints, ellipsis and need to truncate supplied ad copy to a code-point budget with a chosen ellipsis.
How to use the tool and how it works
- Enter copyText, maximumCodePoints, ellipsis. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read displayText, truncated. Inspect truncated before interpreting the associated values.
Require maximumCodePoints nonnegative safe whole; count Array.from(copyText). Preserve text if already within budget; otherwise require ellipsis code-point length<=budget, reserve it and append it to the retained prefix.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| copyText | Copy Text | Required. Text; maximum UTF-16 length 8192. |
| maximumCodePoints | Budget in Array.from code points, not graphemes or display width. | Required. Safe integer; minimum 0. |
| ellipsis | Literal suffix reserved only when truncating; may be empty or longer than budget when no truncation is needed. | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| displayText | Display Text | Required. Text; maximum UTF-16 length 8192. |
| truncated | Truncated | Required. Boolean. |
{
"input": {
"copyText": "Hello world",
"maximumCodePoints": 8,
"ellipsis": "…"
},
"output": {
"displayText": "Hello w…",
"truncated": true
}
} Limitations and assumptions
- Ellipsis length is checked only when truncating; empty ellipses are accepted. Code points differ from graphemes, bytes and display width, so combining sequences can be split and no layout or legal adequacy is assessed.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Review actual audience, media, creative and transaction records with the complete measurement and applicable disclosure rules. Verify definitions and rendering before interpreting local counts or flags as effectiveness, billable delivery or compliance.
References
Similar or alternative tools
- Ad Creative Caption Duration Share
Calculate supplied caption-visible share of creative duration.
- Sponsored Label Before After Order Tag
Compare supplied sponsored-label and content start indices.