Generate QR codes with Smart Scripts

Smart Scripts QR codes let you send desktop visitors from your web-to-app landing page to your app. Users who reach your landing page on a desktop computer can't install or open your app on that device. Smart Scripts turns the Adjust link it generates into a QR code that desktop visitors scan with their phone, so they go straight to the app store or your app. Attribution to the original web source is kept. After you follow this guide, your landing page shows a Smart Scripts QR code to desktop visitors.

  • Convert desktop traffic into app users
  • Keep attribution to the original web source
  • No third-party QR code library needed
  • Reuses your existing Smart Script mapping

What does it do?

Smart Scripts QR codes encode the outgoing Adjust link that Smart Scripts creates from your landing page URL. The QR code contains the same campaign parameters, partner logic, and link token as the link behind your Download app button. When a user scans the QR code, Adjust attributes the install or reattribution to the original web source.

Common use cases for Smart Scripts QR codes:

  • Email campaigns where users open the landing page on a desktop computer
  • Paid web campaigns (for example, Meta, Google, or TikTok) that drive desktop traffic to your landing page
  • "Get the app" sections on your desktop website

Smart Scripts QR codes are most valuable for apps with significant desktop web traffic, such as e-commerce, finance, travel, and media apps.

What it doesn't do

  • Smart Scripts QR codes support only size, margin, dot color, and background color. Logos, dot and corner shapes, background images, and labels aren't supported.
  • QR code styles and templates set up in the Adjust dashboard don't apply to Smart Scripts QR codes.
  • The QR code contains the full Adjust link, not a short link. Smart Scripts QR codes are designed to be scanned from a screen, not printed.
  • Smart Scripts returns QR codes in SVG format only.
  • The Smart Scripts Test Tool shows the outgoing Adjust link but doesn't preview the QR code.
  • Smart Scripts doesn't detect the visitor's device. Your website decides when to show the QR code.

How does it work?

  1. Smart Scripts reads the landing page URL and generates the outgoing Adjust link, using the same mapping as createLink.
  2. Smart Scripts encodes the Adjust link into a QR code in the user's browser. It doesn't send an extra request to Adjust.
  3. Smart Scripts returns the QR code as an SVG string through a Promise.
  4. Your website inserts the SVG into an HTML element on the landing page.
  5. The user scans the QR code with their phone and opens the Adjust link. Adjust redirects the user to the app store or the app and attributes the install to the web source.
Smart scripts QR code Desktop web to app flow diagram

Smart Scripts provides two QR code methods:

  • generateQRCode(mapping, options): Creates the Adjust link from your Smart Script mapping and returns it as a QR code. Use this method when you only need the QR code.
  • generateQRCodeFromLink(link, options): Returns a QR code for an Adjust link you already created with createLink or waitForEnrichedLink. Use this method when your page shows both a link and a QR code, or when the QR code must include the Facebook Pixel ID. If link is null, the method resolves to null.
Note:

generateQRCode uses the same link as createLink, so it doesn't include the Facebook Pixel ID. To include the Pixel ID, create the link with waitForEnrichedLink and pass the result to generateQRCodeFromLink

Get started

Before you add Smart Scripts QR codes to your landing page, make sure you have:

  • The Smart Scripts add-on. Contact your Adjust representative or sales@adjust.com.
  • Admin or Editor permissions.
  • A Smart Script that is set up and deployed on your landing page. See Set up Smart Scripts.
  • Smart Scripts version 1.8.0 or later. To check the version on your website, run AdjustSmartScript.getVersion() in the browser console.
  • A web developer who can edit your landing page code.

Setup summary

  1. Update your Smart Script
  2. Add a QR code container
  3. Generate the QR code
  4. Customize the QR code

Step 1: Update your Smart Script

Mandatory if your website runs a Smart Scripts version earlier than 1.8.0.

  1. Under Campaign Lab, select Smart Scripts.
  2. Select your Smart Script to open the Script view page.
  3. Select Copy script. The copied code includes a QR code example.
  4. Send the script to your web developer to redeploy on your landing page, or update the tag in Google Tag Manager.

Step 2: Add a QR code container

Add an HTML element to your landing page to hold the QR code, for example:

<div id="qr-code"></div>

Place the element where desktop visitors see it, for example next to or instead of the Download app button.

Step 3: Generate the QR code

Call one of the QR code methods and insert the returned SVG into the HTML element.

Example using the Smart Script mapping:

var container = document.getElementById('qr-code');

AdjustSmartScript.generateQRCode(mapping, {
  size: { width: 200, height: 200, margin: 4 }, // Optional
  style: { dotColor: '#000000', bgColor: '#FFFFFF' } // Optional
})
  .then(function (svg) {
    if (svg && container) {
      container.innerHTML = svg;
    }
  })
  .catch(function (error) {
    // Could not generate the QR code
    // Check the browser console for details
  });

Example using an enriched link that includes the Facebook Pixel ID:

var container = document.getElementById('qr-code');

AdjustSmartScript.waitForEnrichedLink(mapping)
  .then(function (enrichedLink) {
    return AdjustSmartScript.generateQRCodeFromLink(enrichedLink);
  })
  .then(function (svg) {
    if (svg && container) {
      container.innerHTML = svg;
    }
  })
  .catch(function (error) {
    // Could not generate the QR code
    // Check the browser console for details
  });

Your web developer decides when to show the QR code, for example by showing it to desktop visitors and showing the Download app button to mobile visitors.

Step 4: Customize the QR code

Optional. Both QR code methods accept an options object. If you don't pass options, Smart Scripts generates a black-and-white QR code that is 200 x 200 pixels.

  • size.width and size.height: The QR code size in pixels. Default: 200. QR codes are square, so if the values differ, Smart Scripts uses the smaller value.
  • size.margin: The blank border around the QR code, measured in QR code modules (the small squares that make up the code). Default: 4.
  • style.dotColor: The color of the QR code dots, as a hex code. Default: #000000.
  • style.bgColor: The background color, as a hex code. Default: #FFFFFF.

If you enter a negative size or margin, Smart Scripts uses the default value and logs a warning in the browser console. Use dark dots on a light background to keep the QR code easy to scan.

Manage Smart Scripts QR codes

  • Change the QR code size or colors: Smart Scripts QR code options are set in your website code. Update the options object and redeploy the code.
  • Change the link in the QR code: Edit your Smart Script mapping, copy the script again from the Script view page, and redeploy it. Changes to the mapping don't apply until the script is redeployed.
  • Remove the QR code: Remove the QR code method call and the HTML element from your landing page.

Reporting

Smart Scripts QR codes contain the same Adjust link as your Smart Script, so installs and events from QR code scans are attributed to the original web source. Smart Scripts doesn't report QR code scans separately from other clicks on the Smart Scripts link. Find results in Datascape by filtering on the campaign parameters in your Smart Script mapping.

Testing

  1. Open your landing page on a desktop computer with campaign parameters in the URL, for example https://example.com/landing?utm_source=newsletter&utm_campaign=spring_sale.
  2. Check that the QR code appears in the HTML element you chose.
  3. Open the browser console and check the [adjust-smart-script] logs. If the QR code can't be generated, the console shows Cannot generate QR code with the error details.
  4. Scan the QR code with an iOS device and an Android device. Check that each device opens the right app store page, or your app if it's installed.
  5. Compare the link in the QR code with the output of createLink or the Smart Scripts Test Tool for the same landing page URL. The campaign parameters and link token must match.

Next steps

For further questions, contact support@adjust.com.