<commit_before>---
layout: page
title: Setup Line Items for MoPub
description: Setup line items for MoPub
pid: 1
top_nav_section: prebid-mobile
nav_section: prebid-mobile-adops
---


<div class="bs-docs-section" markdown="1">

# Step by Step Line Item Setup for MoPub

* TOC
{:toc }

This page describes step by step how to set up Prebid Mobile line items for MoPub.

## Step 1. Add a line item

- Set the **Type & Priority** to **Non-guaranteed** and **12**, respectively, so the line item will compete with all other demand
- Set the **Rate** to the price you want to target, for example $0.50, in the screenshot below

{: .pb-med-img :}
  ![MoPub Line Item Setup]({{site.github.url}}/assets/images/prebid-mobile/adops-line-item-setup-mopub/mopub1.png "Example MoPub Line Item")

- In the **Advanced Targeting** section, in **Keywords** target **hb_pb:0.50**

{: .pb-med-img :}
  ![MoPub Advanced Targeting Setup]({{site.github.url}}/assets/images/prebid-mobile/adops-line-item-setup-mopub/mopub2.png "Example MoPub Advanced Targeting")

For each level of pricing granularity you need, you will have to set up one line item/creative pair.

Line items must be set up to target custom keywords that include bid price information. The bid price keywords tell you how much the buyer bid on the impression.

## Step 2. Add creatives to your line item

Banner creatives must be HTML banners with the **Format** set to **Banner** that include the code shown below.

{: .pb-med-img :}
  ![MoPub Creative Setup]({{site.github.url}}/assets/images/prebid-mobile/adops-line-item-setup-mopub/mopub3.png "Example MoPub Creative")

The **hb_cache_id** variable stands for the cache id that will load the ad markup from the bid from Prebid Cache. Within each line item, for each ad unit size there should be one creative with this content. 

```
<script type="text/javascript" src = "//acdn.adnxs.com/mobile/prebid/pbm.js"></script>
<script type="text/javascript">
    pbm.showAdFromCacheId({
        admCacheID: '%%KEYWORD:hb_cache_id%%’  
    });
</script>
```

## Step 3. Duplicate line items

Duplicate your line items according to your [price granularity]({{site.github.url}}/prebid-mobile/adops-price-granularity.html) setting. 

</div><commit_msg>Fixing single quote character in Creative snippet (#328)<commit_after>---
layout: page
title: Setup Line Items for MoPub
description: Setup line items for MoPub
pid: 1
top_nav_section: prebid-mobile
nav_section: prebid-mobile-adops
---


<div class="bs-docs-section" markdown="1">

# Step by Step Line Item Setup for MoPub

* TOC
{:toc }

This page describes step by step how to set up Prebid Mobile line items for MoPub.

## Step 1. Add a line item

- Set the **Type & Priority** to **Non-guaranteed** and **12**, respectively, so the line item will compete with all other demand
- Set the **Rate** to the price you want to target, for example $0.50, in the screenshot below

{: .pb-med-img :}
  ![MoPub Line Item Setup]({{site.github.url}}/assets/images/prebid-mobile/adops-line-item-setup-mopub/mopub1.png "Example MoPub Line Item")

- In the **Advanced Targeting** section, in **Keywords** target **hb_pb:0.50**

{: .pb-med-img :}
  ![MoPub Advanced Targeting Setup]({{site.github.url}}/assets/images/prebid-mobile/adops-line-item-setup-mopub/mopub2.png "Example MoPub Advanced Targeting")

For each level of pricing granularity you need, you will have to set up one line item/creative pair.

Line items must be set up to target custom keywords that include bid price information. The bid price keywords tell you how much the buyer bid on the impression.

## Step 2. Add creatives to your line item

Banner creatives must be HTML banners with the **Format** set to **Banner** that include the code shown below.

{: .pb-med-img :}
  ![MoPub Creative Setup]({{site.github.url}}/assets/images/prebid-mobile/adops-line-item-setup-mopub/mopub3.png "Example MoPub Creative")

The **hb_cache_id** variable stands for the cache id that will load the ad markup from the bid from Prebid Cache. Within each line item, for each ad unit size there should be one creative with this content. 

```
<script type="text/javascript" src = "//acdn.adnxs.com/mobile/prebid/pbm.js"></script>
<script type="text/javascript">
    pbm.showAdFromCacheId({
        admCacheID: '%%KEYWORD:hb_cache_id%%'  
    });
</script>
```

## Step 3. Duplicate line items

Duplicate your line items according to your [price granularity]({{site.github.url}}/prebid-mobile/adops-price-granularity.html) setting. 

</div>

{'fraction_non_alphanumeric': 0.1191423519009726, 'fraction_numerical': 0.007736516357206013, 'mean_word_length': 4.243337195828505, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5537696', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1401, 'n_words': 530}