# Goal bar: Code

> Theme code for the goal bar widget from the app's theme code library, with where to paste it in Dawn and Horizon.

Source: https://backtrackhq.com/docs/widgets/goal-bar/code/

Use this code where your theme has no slot for the app block. It comes
from the theme code library on the app's **Storefront blocks** page.
To open it, go to **Promotions** > **More actions** > **See all blocks**.

For every widget's code in one place, see
[Add AndOr with code](https://backtrackhq.com/docs/widgets/add-with-code/).

## One-line tag

Each tag is one line. The app embed fills it in with the same widget as
the matching app block.

> **Note:** Every tag needs the AndOr Discount Display app embed
> turned on. With the embed off, the tag shows nothing. See
> [what works without the app embed](https://backtrackhq.com/docs/widgets/app-embed/#what-works-without-the-app-embed).

Where to paste a tag:

- **Horizon:** in the theme editor, add a **Custom Liquid** block to
  the product template and paste the tag into it.
- **Dawn and similar themes:** paste the tag into the product section
  code, usually `sections/main-product.liquid`.

### Order goal bar, one line

"You're $30 away from 10% off your order", with a progress bar that follows the cart, as a single tag the app embed fills in.

```liquid
<andor-goal></andor-goal>
```

(Screenshot: The pasted goal bar on a product page: the sentence, the bar and the reward steps)

**Where it goes:** Wherever you want the bar. Good spots are the top of every page (in `layout/theme.liquid`, just after the opening `<body>` tag), your cart template, or beside the add-to-cart button in `sections/main-product.liquid`. It sits in the normal flow, so there is no positioning to get wrong.

For the bar in your cart drawer on EVERY page, paste `<andor-goal data-drawer="only"></andor-goal>` once in `layout/theme.liquid`, just after the opening `<body>` tag. It shows nothing on the page and fills the drawer when it opens. This needs Horizon 4.0 or Dawn 15.5 or later. On a page that also shows a bar, the drawer copies that bar, so you never see two.

More: [Order goal bar in One-line tags](https://backtrackhq.com/docs/developers/one-line-tags/#order-goal-bar).
