Skip to content

Allow Custom or Truncated Category Names for Product Set Sync #111

Open
@CalzaFino

Description

@CalzaFino

Currently, when syncing Magento categories to Meta Commerce (Facebook/Instagram), the module uses the full category name or path (via $category->getName() or similar logic) to generate the Product Set name.

Meta enforces a strict 100-character limit on Product Set names. However, in Magento stores that use SEO-optimized long category names or full breadcrumb-style paths, this limit is easily exceeded, causing sync errors such as:
{
"error_user_title": "Product set name is too long",
"error_user_msg": "The name of the product set you're trying to access is longer than our allowed limit of 100. Please reduce the length to continue using it.",
"error_subcode": 1798252
}

Why This Matters
Magento merchants commonly use:

Descriptive or SEO-rich category names (often >100 characters)

Nested category structures with long paths

Multiple store views (with different naming needs)

Since the module builds Product Sets automatically from category names, these setups often break syncs and require manual edits or core hacks to avoid exceeding the character limit.

Suggested Solution
Introduce a configurable or extensible method for determining the Product Set name, such as:

✅ Use a custom category attribute (e.g., meta_set_name or fallback to name)

✅ Allow a plugin/hook to filter or truncate the Set name before it’s pushed

✅ Automatically truncate Set names >100 chars and log a warning

✅ Expose logic in a public or protected method, so merchants can override it

Benefits
Prevents sync failures without hacks

Maintains compatibility with Magento SEO practices

Enables localization and flexibility across store views

Reduces support overhead for long-name errors

Example Workaround (Current Hack)
We’re currently patching:

$name = $category->getData('custom_breadcrumb') ?: $category->getName();
if (mb_strlen($name) > 100) {
$name = mb_substr($name, 0, 97) . '…';
}
…but this logic belongs in the module itself, ideally as a configurable or overridable behavior.

Request
Please consider making the Product Set naming logic:

Pluggable (via DI or config)

Attribute-aware (custom name field)

Resilient (auto-truncate long names)

This will help more Magento merchants maintain compatibility with Meta’s catalog limits while preserving their SEO structures and store view strategies.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions