# Tagging from a dictionary - python

**URL:** <https://discuss.elastic.co/t/tagging-from-a-dictionary-python/168855>\
**Category:** APM\
**Created:** [February 18, 2019, 3:14pm UTC](https://discuss.elastic.co/t/tagging-from-a-dictionary-python/168855 "2019-02-18T15:14:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesNotJamez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jamesnotjamez/32/45736_2.png) [@JamesNotJamez](https://discuss.elastic.co/u/JamesNotJamez)\
**Post date:** [February 18, 2019, 3:14pm UTC](https://discuss.elastic.co/t/tagging-from-a-dictionary-python/168855/1 "2019-02-18T15:14:28Z")

</div>

Is it possible to set tags from a dictionary? I have a dict of True / False values that I want to tag and aggregate but the public api docs only shows `elasticapm.tag(ecommerce=True, dollar_value=47.12)` which requires supplying a variable name, so I cant iterate over my dict and add the tags like this

```auto
for k,v in payload.items():
    elasticapm.tag(k=v)

```

Many thanks

---

<div class="post-metadata">

**Author:** ![roncohen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roncohen/32/22881_2.png) [@roncohen](https://discuss.elastic.co/u/roncohen)\
**Post date:** [February 18, 2019, 3:26pm UTC](https://discuss.elastic.co/t/tagging-from-a-dictionary-python/168855/2 "2019-02-18T15:26:18Z")

</div>

Hi James,

How about:

```auto
elasticapm.tag(**payload)

```

best,  
Ron

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 11, 2019, 11:26am UTC](https://discuss.elastic.co/t/tagging-from-a-dictionary-python/168855/3 "2019-03-11T11:26:19Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
