> For the complete documentation index, see [llms.txt](https://ce-docs.keywordrush.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ce-docs.keywordrush.com/updating-products/price-history.md).

# Price History

Content Egg saves a product's price each time it changes. The **Price History** block turns those prices into a chart, a verdict on today's price, and the lowest and highest price. Price alerts use the same prices.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-4681a0ee38b8e4c1b00029a05dc52da672f9bd22%2Fprice-history-block.webp?alt=media" alt=""><figcaption><p>The Price History block on a comparison post</p></figcaption></figure>

### Turn On Price History

1. Go to **Content Egg > Settings > Price alerts**.
2. Set **Price History** to the number of days to keep. The default is 365, the most is 1875. `0` turns price history off.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-522c0e00a0f7c81e6449d05e0b76bc8241f3f6d7%2Fprice-history-settings.webp?alt=media" alt=""><figcaption><p>Content Egg → Settings → Price alerts</p></figcaption></figure>

A point is saved when a price changes. The chart appears once a product has a price saved on an earlier day. The verdict needs 30 days of history and more than one price. **Content Egg > Price History** appears in the menu while price history is on.

### Add the Block to a Post

* **Block editor:** add the **Price History** block (in the Content Egg group), or a **CE Products** block with the **Price history** template.
* **Shortcode:**

```
[content-egg-block template=price_history]
```

The block shows every product of the post. Choose products with the block settings, or with `products="id1,id2"` in the shortcode.

These shortcode parameters change the block:

* `period` opens a tab first: `30`, `90`, `180` or `365` days. The default is 180.
* `hide` removes parts: `verdict`, `stores` (the shop lines), `facts` (the highest, lowest and current price) and `best` (the best price line). Example: `hide=verdict,stores`. With `hide=best` the chart starts on the shop lines. It has no effect when there is one offer, or when the shop lines are hidden, because the chart would be left without a line.
* `stores_limit` sets how many shops are listed under the chart before "+N more". The default is 5.

On a **module** template, use `[content-egg module=Awin template=price_tracker_alert]`: it shows the product with the alert form and its price history.

### What Visitors See

* **A verdict.** "The price is low right now", "typical" or "high", with the percentage and a bar that marks today's price. The typical range is the middle half of the prices of the last 90 days, each price counted for the days it held. Days out of stock do not count.
* **Period tabs.** 30 days, 90 days, 6 months and 1 year. Visitors switch without a page reload. A tab appears when there is history for it.
* **The best price over time.** One line shows the lowest price among the shops on each day. Under the chart, a visitor can switch on a line for each shop, and switch the best price line off. The chart is never empty: switching off the last line brings the other kind back.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-3a7ede49bcf6d4c2f30870f149e2f3c8a15cf719%2Fprice-history-shops.webp?alt=media" alt=""><figcaption><p>Shop lines, switched on under the chart</p></figcaption></figure>

* **Out of stock.** When a product was not available, the line stops and the period is shaded. The Current Price then says "Out of stock".

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-24b1a6f5914df087f2531c8ea377442756f83e85%2Fprice-history-out-of-stock.webp?alt=media" alt=""><figcaption><p>A product that is out of stock</p></figcaption></figure>

* **Highest, lowest and current price** for the period the visitor picked, with the shop and the date. The current price links to the shop.

The date format follows **Settings > General** in WordPress. To change a text or translate it, go to **Content Egg > Frontend > Frontend Texts**.

### Use the Block in the Editor

The block has settings in the editor sidebar:

* **Variant:** Compact shows only the verdict and the chart.
* **Opens on:** the first period tab.
* **Parts:** switch the verdict, the shop lines, the best price line and the highest, lowest and current price on or off.
* **Shops listed before "more":** how many shops show under the chart.
* **Products:** choose the products. With none chosen, the block shows every product of the post.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-baefcb9f066b23c18136f3507910e08d011fda3f%2Fprice-history-editor.webp?alt=media" alt=""><figcaption><p>The Price History block in the block editor</p></figcaption></figure>

The chart itself is drawn on the published page. The editor shows a placeholder.

### Fix Wrong Prices

Shops and feeds sometimes return a wrong price for one update, for example $1 instead of $299. Content Egg hides such a point itself when the price jumps far and returns to the old level on the next update. The hidden point no longer shows on a chart, in the lowest price, or in price alerts.

To look at the points of a product, go to **Content Egg > Price History**, search for the product and open it. You can also click **Price history** under a product in **Content Egg > All Products**.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-5d135749592cd537aa72c7306b2a88e8f4129263%2Fprice-history-admin.webp?alt=media" alt=""><figcaption><p>Content Egg → Price History</p></figcaption></figure>

For each point you can:

* **Hide** it. It is ignored until you restore it.
* **Restore** a hidden point. Content Egg will not hide it again.
* **Delete** it.

**Clear history** deletes all points of the product. **Export CSV** downloads them.

### How Prices Are Saved

* A point is saved when the price or the stock status changes. Several changes in one day are all kept; the chart uses the last one of the day.
* Points older than the days you set are deleted once a day. The price in force when that period starts is kept, so a product that has not changed its price for a year still shows a line.
* Cleanup runs in the background through WP-Cron. If `DISABLE_WP_CRON` is set in `wp-config.php`, make sure a server cron job calls `wp-cron.php`.

{% hint style="info" %}
Amazon has its own rules about showing price history. Check the terms of your Amazon program before you show it for Amazon products.
{% endhint %}
