Hi Sebastian,
There is no limit; use as many as you like. However, the syntax highlighter is not perfect, and under certain conditions, it doesn't properly detect the beginning and end of certain statements. I would like to stress that this only happens very rarely.
Usually, however, it is correct, and the reason it doesn't highlight the closing brace is due to a syntax error somewhere in your code. If you are absolutely sure that there is no syntax error, then it is probable that you've written some valid code that the syntax highlighter doesn't quite understand. I would advise you to proceed with caution and test your code on dev/qa before publishing to prod, just in case there is a syntax error.
One thing that occasionally catches me out, is not closing the parentheses on an if statement when using a regular expression. e.g.:
if (/home/.test(b.page_name) {
// notice the missing parenthesis above!
}
Hope this helps. Feel free to share the code with me directly if you want me to review it (or send me a private message and let me know which account/profile you're using, and the name of the extension).
Hope this is useful.
Craig.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.