---
title: 'Discount Code by Link'
url: 'https://info.srv.kowal.co/docs/magento/modules/discount-code-by-link'
markdown: 'https://info.srv.kowal.co/docs/magento/modules/discount-code-by-link.md'
lang: en
date: '2026-11-30'
description: 'Create a coupon link for an email or ad with ?discount=SPRING. Keep your campaign tracking parameters and apply the discount when a qualifying item is added.'
taxonomy:
  category:
    - docs
    - Magento
    - Modules
  tag:
    - promotions
    - checkout
---

# Discount Code by Link

**Composer** `kowal/module-discountcodebylink` · **Version** 1.0.25

## Product page

A product page on kowal.co has not been confirmed.

## Description

Passes a coupon code in a landing page URL and applies it to the cart under the Magento cart price rule.

## For whom

For campaign managers distributing coupon links through newsletters, advertisements or landing pages.

## Features

- Pass a coupon as a URL parameter.
- Remember a code when the visitor arrives before adding merchandise.
- Optionally accept the coupon in the URL path.

## Installation

From the Magento root, with Composer access to the Kowal package, run

```sh
composer require kowal/module-discountcodebylink
bin/magento module:enable Kowal_DiscountCodeByLink
bin/magento setup:upgrade
bin/magento cache:clean
```

## Configuration

Create an active coupon under **Marketing → Cart Price Rules**. Enable the extension in the Kowal discount URL settings. The default parameter is `discount`. For a coupon named SPRING, use a link such as `/offers?discount=SPRING`. If the URL already has a query parameter, append `&discount=SPRING`.

The extension remembers the code in a cookie so a customer can visit the landing page before adding a product. To use a path such as `/offers/discount/SPRING`, turn on URL path support.

## Requirements / notes

The coupon and its cart price rule must be valid for the visitor’s website and cart. Use a fresh session when comparing campaigns so a previously stored coupon does not affect the test.

## FAQ

**How do I add a coupon to a campaign URL that already contains tracking parameters?**

Append the coupon with an ampersand. With the default parameter name, /offers?utm\_source=newsletter&discount=SPRING carries both the tracking value and the coupon.

## Verify the installation

Open the link in a fresh session, add a qualifying product and check the coupon and discount amount in the cart. If no discount appears, check the rule’s website, dates, usage limits and conditions.

---

## Navigation

- Parent: [Magento 2 Extensions](https://info.srv.kowal.co/docs/magento/modules.md)
- Previous: [Auto Invoice](https://info.srv.kowal.co/docs/magento/modules/auto-invoice.md)
- Next: [Language Flags](https://info.srv.kowal.co/docs/magento/modules/language-flags.md)
