Skip to main content

Error 402: Channel grouping regex error

David Ahlstedt avatar
Written by David Ahlstedt
Updated over a week ago

What is happening?
The Attribution Model failed to process your ad platform data because it encountered an invalid syntax in your Custom Channel Grouping rules. The system relies on specific "Regular Expressions" (regex) to categorize your traffic, and a broken pattern has caused the entire request to stall.

Error: Error in parsing regular expression for the Channel Grouping in the BigQuery request. Please update the regex or contact Alvie support for help.


Why did this happen?
This error is almost always caused by a typo or a structural mistake in the regex patterns used to define your marketing channels. Common causes include:

  • Unclosed Parentheses: Using an open bracket ( without a closing ).

  • Dangling Meta-characters: Using symbols like +, *, or ? at the very start of a string or without a preceding character.

  • Illegal Escape Sequences: Using single backslashes \ where double backslashes \\ are required (especially in BigQuery environments).

  • Case Sensitivity: Regex is case-sensitive by default; if your traffic is CPC but your regex only looks for cpc, it might return unexpected results or fail if the pattern is malformed.

  • Special Character Conflicts: Using reserved characters like . or | without "escaping" them (e.g., using . instead of \. to match a literal dot in a URL).

Solution Follow these steps to resolve the issue:

  1. Navigate to Settings: Open the Attribution Model configuration and locate the Custom Channel Grouping section.

  2. Locate the Source: Review each custom rule you have created (e.g., "Brand Search", "Social Retargeting").

  3. Action: Audit your regex patterns for common mistakes:

    • Check the Pipe |: Ensure you don't have a trailing pipe at the end of a list (e.g., facebook|instagram| is invalid).

    • Standardize Brackets: Ensure all () and [] are correctly paired.

    • Escape Special Characters: If you want to match a literal symbol, add a backslash (e.g., google\.com instead of google.com).

    • Use a Tester: Copy your regex into a tool like Regex101 (set it to the "Golang/RE2" flavor, which BigQuery uses) to see if it reports any syntax errors.

  4. Verify: Once you have corrected the syntax, click Save and then Run now on the Attribution Model. The status should turn Healthy (Green).


Prevention & Tips To avoid seeing this error again:

  • Case-Insensitive Flag: Add (?i) at the beginning of your regex (e.g., (?i)facebook) to ensure it matches regardless of capitalization.

  • Documentation: Refer to the Google SQL Regex documentation for a complete list of supported symbols.

If you encounter any further issues or need additional assistance, please don't hesitate to reach out to the Alvie support team.

Did this answer your question?