---
url: "https://vueda.dev/v3/reference/api/py/vueda.vdq.tracking/MetadataEmailTrackingStrategy.md"
title: "MetadataEmailTrackingStrategy"
---

# MetadataEmailTrackingStrategy

## Overview

Carry the queue item's primary key in the email's Anymail ``metadata``.

This is the default strategy. Anymail sends ``metadata`` to the ESP and returns it on tracking events for
the ESPs that support it.

## `attach` {#attach}

Add tracking data that identifies ``queue_item`` to ``email`` before it is sent.

### Signature {#attach-signature}

`attach(self, email, queue_item)`

#### Parameters {#attach-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="attach-param-email">email</span> |  | yes |  |  |
| <span id="attach-param-queue_item">queue_item</span> |  | yes |  |  |

### Source {#attach-source}

`server/vueda/vdq/tracking.py:43`

## `find_queue_item` {#find_queue_item}

Return the queue item that the tracking data on ``event`` identifies, or ``None``.

### Signature {#find_queue_item-signature}

`find_queue_item(self, event)`

#### Parameters {#find_queue_item-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="find_queue_item-param-event">event</span> |  | yes |  |  |

#### Returns {#find_queue_item-returns}

`vueda.vdq.models.QueueItem | None`

### Source {#find_queue_item-source}

`server/vueda/vdq/tracking.py:48`

## `metadata_key` {#metadata_key}

## Source

`server/vueda/vdq/tracking.py:33`
