Install the conversion script: GTM, Shopify, PrestaShop or JavaScript

On this page

The conversion script tells Tapper when a visitor converts, with the order value, currency and order id. Your entity's key is already in every snippet.

Before you start

Where to find it

  1. With more than one protected entity, pick the entity in the switcher at the top of the sidebar.
  2. Under Setup, click Website, then Monitoring.
  3. Scroll to Conversion script and pick Google Tag Manager, Shopify, PrestaShop or JavaScript.

The Conversion script section with its four tabs

Google Tag Manager

The tab builds a Custom HTML tag for you.

  1. Fill in Order Value variable, Currency variable and Transaction ID variable with your GTM variables, typed exactly as in the Name column of your Tag Manager Variables list, for example DLV - ecommerce.value. The snippet updates as you type.
  2. Copy the snippet.
  3. In GTM, create a Custom HTML tag, paste the snippet and fire it on your purchase trigger.
  4. Save the tag, then submit and publish the container.

Currency and Transaction ID are optional. Without a currency, the value is recorded in your connected ad account's currency. The transaction id is used to avoid counting an order twice.

If your site has no dataLayer ecommerce values, turn on My site has no dataLayer ecommerce variables. The tag then records a plain conversion with no value.

You can also use the Tapper - Conversion Script template from the GTM gallery. Enter your key in Public Key (pk) and map Order Value, Currency and Transaction ID (the last two optional) to ecommerce.value, ecommerce.currency and ecommerce.transaction_id. GA4 ecommerce tracking fills these on the purchase event.

Shopify

Shopify conversions come from a checkout pixel under Settings, Customer events, which records order value, currency and order id by itself. See Install Tapper on a Shopify store.

PrestaShop

The PrestaShop snippet goes right after the opening <body> tag, in place of the monitoring script, not next to it. It does everything the monitoring script does, plus add-to-cart, checkout and purchase capture, and reads order value, currency and order id from your checkout.

JavaScript

Use this tab when you can edit the confirmation page.

  1. In Where does your order total live?, enter the JavaScript that holds the total, such as window.orderTotal.
  2. Optionally fill in Currency (for example 'USD' with quotes, or a variable) and Order id.
  3. Copy the snippet and paste it right after the opening <body> tag of the page a customer reaches only once the order is placed or the application approved.

Never put it on a landing page. A fixed number such as 149.90 fires on every view, so on a landing page every ad visitor becomes a conversion. If the total cannot be read, the snippet still records a plain conversion.

The JavaScript tab with its three fields and the snippet

To call Tapper directly, use window.tapper.push(amount, currency?, orderId?):

window.tapper.push(49.99, "USD", "ORD-1042");

The amount must be a number (49.99, never "49.99"). Without a currency, the value is recorded in your ad account's currency. Stores selling in several currencies must always pass a 3-letter code, and an amount of exactly 1 always needs one.

What happens next

  • Conversions show on the dashboard's Conversions tab, for example in the Conversion events tile ("Tracked by Tapper").
  • Your monthly report shows its conversion cards (Conversions, CPA, Conversion Rate) only when conversions are verified.
  • If you think a real customer was blocked, see A real customer was blocked: what you can do.

If something goes wrong

  • Almost every ad visitor converts. The snippet is on a landing page, or a fixed amount fires on a page everyone sees. Move it to the confirmation page.
  • Every purchase counts twice. The container has two Tapper conversion tags. Keep one.
  • Values are in the wrong currency. Pass the currency as a 3-letter code.

Still need help?

Chat with our team and mention this article.