New User: Avalanche of Errors (Getting Smothered)

Check out @rlkoshak 's tutorial on how to use Code Fences - that’ll make your posts much more readable to others.

The thing that doesn’t belong in the ruleset is the JS() transformation. Those can be done in the items and sitemap files, but not in the rules syntax (as far as I know, someone may correct me on that). Your best bet is to either write out the entire javascript string, or put them in global variables at the front of the rules file and concatenate them to your http request string as needed.