s-web/blob/a9160f62f8ebff02285779974620ad3ff260f5ac/snippets/perf-next/index/perf_add_custom_attributes.js#L8-L23)

###  Web namespaced API

    
    
    const trace = perf.trace("test_trace");
    trace.putAttribute("experiment", "A");
    
    // Update scenario
    trace.putAttribute("experiment", "B");
    
    // Reading scenario
    const experimentValue = trace.getAttribute("experiment");
    
    // Delete scenario
    trace.removeAttribute("experiment");
    
    // Read attributes
    const traceAttributes = trace.getAttributes();
    
    [index.js](https://github.com/firebase/snippets-web/blob/a9160f62f8ebff02285779974620ad3ff260f5ac/perf/index.js#L56-L69)

Send feedback

Except as otherwise noted, the content of this page is licensed under the [
Creative Commons Attribution 4.0 License
](https://creativecommons.org/licenses/by/4.0/) , and code samples are
licensed under the [ Apache 2.0 License
](https://www.apache.org/licenses/LICENSE-2.0) . For details, see the [ Google
Developers Site Policies ](https://developers.google.com/site-policies) . Java
is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-04-16 UTC.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing
the information I need" },{ "type": "thumb-down", "id":
"tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{
"type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type":
"thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{
"type": "thumb-down", "id": "otherDown", "label":"Other" }]  [{ "type":
"thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type":
"thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type":
"thumb-up", "id": "otherUp", "label":"Other" }]  Need to tell us more?

  * ###  Learn 

    * [ Guides ](/docs/guides/)
    * [ Reference ](/docs/reference/)
    * [ Samples ](/docs/samples/)
    * [ Libraries ](/docs/libraries/)
    * [ GitHub ](//github.com/firebase/)
  * ###  Stay connected 

    * [ Blog ](//firebase.blog)
    * [ Firebase Summit ](/summit/)
    * [ Twitter ](//twitter.com/Firebase)
    * [ YouTube ](//www.youtube.com/user/Firebase)
  * ###  Support 

    * [ Contact support ](/support/)
    * [ Stack Overflow ](//stackoverflow.com/questions/tagged/firebase)
    * [ Slack community ](//firebase.community/)
    * [ Google group ](//groups.google.com/forum/#!forum/firebase-talk)
    * [ Release notes ](/support/releases)
    * [ FAQs ](/support/faq/)

[ ![Google Developers](https://www.gstatic.com/devrel-
devsite/prod/v66c4dc9b65fea2172a0927d7be81b5b5d946ea60fc02578dd7c264b2c2852152/firebase/images/lockup-
google-for-developers.svg) ](https://developers.google.com/)

  * [ Android ](//developer.android.com)
  * [ Chrome ](//developer.chrome.com/home)
  * [ Firebase ](//firebase.google.com)
  * [ Google Cloud Platform ](//cloud.google.com)
  * [ All products ](//developers.google.com/products/)

  * [ Terms ](/terms/)
  * [ Privacy ](//policies.google.com/privacy)
  * Manage cookies 

  * English 
  * Deutsch 
  * Español 
  * Español – América Latina 
  * Français 
  * Indonesia 
  * Italiano 
  * Polski 
  * Português 
  * Português – Brasil 
  * Tiếng Việt 
  * Türkçe 
  * Русский 
  * עברית 
  * العربيّة 
  * فارسی 
  * हिंदी 
  * বাংলা 
  * ภาษาไทย 
  * 中文 – 简体 
  * 中文 – 繁體 
  * 日本語 
  * 한국어