nopSolutions/nopCommerce · error · NopException
{error.Code} - {error.Message}{Environment.NewLine}Debug ID:
Error message
{error.Code} - {error.Message}{Environment.NewLine}Debug ID: {error.DebugId} What it means
Thrown by the Conversions API integration when the Facebook Conversions API response, deserialized anonymously, contains a non-empty error.Message. The message format is '{Code} - {Message}\nDebug ID: {DebugId}', where DebugId is Facebook's correlation token for support.
Source
Thrown at src/Plugins/Nop.Plugin.Widgets.FacebookPixel/Services/FacebookPixelService.cs:589
var conversionsApiConfigurations = configurations.Where(configuration => configuration.ConversionsApiEnabled).ToList();
var pixelConfigurations = configurations.Where(configuration => configuration.PixelScriptEnabled).ToList();
if (!conversionsApiConfigurations.Any() && !pixelConfigurations.Any())
return false;
var model = await prepareModel();
if (pixelConfigurations.Any())
await PrepareEventScriptAsync(model);
var logErrors = true; //set it to false to ignore Conversions API errors
foreach (var configuration in conversionsApiConfigurations)
{
await HandleFunctionAsync(async () =>
{
var response = await _facebookConversionsHttpClient.SendEventAsync(configuration, model);
var error = JsonConvert.DeserializeAnonymousType(response, new { Error = new ApiError() })?.Error;
if (!string.IsNullOrEmpty(error?.Message))
throw new NopException($"{error.Code} - {error.Message}{Environment.NewLine}Debug ID: {error.DebugId}");
return true;
}, logErrors);
}
return true;
}
/// <summary>
/// Prepare user data for conversions api
/// </summary>
/// <returns>
/// <param name="customer">Customer</param>
/// A task that represents the asynchronous operation
/// The task result contains the user data
/// </returns>
protected async Task<ConversionsEventUserData> PrepareUserDataAsync(Customer customer = null)
{View on GitHub (pinned to 64bdf2ff08)
Solutions
- Capture the DebugId from the exception and use it in the Facebook Business support / Graph API explorer to identify the exact failure.
- Verify the access token is valid and has access to the configured Pixel (re-issue via Facebook Login).
- Validate the ConversionsEvent payload (required fields, correctly hashed user data, unique event_id) before sending.
Example fix
// before
if (!string.IsNullOrEmpty(error?.Message))
throw new NopException($"{error.Code} - {error.Message}{Environment.NewLine}Debug ID: {error.DebugId}");
// after — keep the error but include DebugId programmatically for retries
throw new ConversionsApiException(error.Code, error.Message, error.DebugId);
// caller:
// if (ex.Code == "rate_limit") await Task.Delay(backoff); retry once; Defensive patterns
Strategy: retry
Validate before calling
if (string.IsNullOrWhiteSpace(configuration.AccessToken) || configuration.PixelId <= 0)
throw new InvalidOperationException("Facebook Pixel configuration incomplete"); Type guard
static bool IsConfigComplete(FacebookPixelConfiguration c) => !string.IsNullOrWhiteSpace(c?.AccessToken) && c.PixelId > 0;
Try / catch
try { await SendEventAsync(configuration, model); }
catch (NopException ex) when (ex.Message.Contains("Debug ID"))
{ _logger.LogError("Conversions API error DebugId={DebugId}", ExtractDebugId(ex.Message));
if (IsTransient(ex.Message)) await RetryAsync(() => SendEventAsync(configuration, model)); } Prevention
- Keep the access token fresh and verify it owns the configured Pixel.
- Hash user data and include a unique event_id to avoid deduplication errors.
- Capture and persist the DebugId for Facebook support escalation.
When it happens
Trigger: SendEventAsync returns a response whose JSON has an Error object with Code/Message — typical causes: invalid access token, missing/pixel-id mismatch, event payload failing validation, rate limiting, duplicate event_id.
Common situations: Access token expired or revoked; Pixel ID mismatch between configuration and token's owned pixels; missing required user data hashing; duplicated request event_id causing deduplication error; graph API rate limit.
Related errors
- Shopping was not initiated by customer
- Purchase was not initiated by customer
- Item HS classification error: response content invalid - {ex
- Item HS classification error: {error}
- No configuration found with the specified id
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/886977a94aca9765.
Report an issue: GitHub.