Troubleshooting Custom Coded Actions

We had to adjust the search query, converting the referrer id to a string so it could be matched. We also changed some of the syntaxes within the search as they were outdated.
Have a look at this and make some amends to yours.

Note: instead of “referrer” I named my property referrer code.