# File lib/new_relic/agent/javascript_instrumentor.rb, line 163
      def add_attributes(data, txn)
        return unless txn

        atts = {}
        append_custom_attributes!(txn, atts)
        append_agent_attributes!(txn, atts)

        unless atts.empty?
          json = NewRelic::JSONWrapper.dump(atts)
          data[ATTS_KEY] = obfuscator.obfuscate(json)
        end
      end