Custom fields in index pattern

Setting a tag worked, thank you very much!
Although I used transaction.setTag() instead of apm.setTag(), that function not mentioned in the Transaction API, but does work. The same is true for transaction.setCustomContext()

Is there any way to insert multiple values at the same time as tags, or does each tag required its own function call? transaction.setCustomContext() was very useful to me because I could add a large amount of entries to it at the same time.