Skip to main content

How to Set Up Lunio Conversion Tracking (Client-Side)

Set up Lunio conversion tracking, using either the Google Tag Manager template or a direct script install, so Lunio can see your purchase and lead conversions across all supported ad platforms.

Lunio conversion tracking lets Lunio see when someone completes a key action on your site, such as a purchase or a lead, so you can see how your converting traffic behaves and, if you choose, whitelist those genuine converters so they are never excluded from your ads.


Before You Start

You will need:

  • Admin access to your Lunio dashboard

  • The Lunio mplat script already installed on your site, as Lunio cannot monitor traffic without it. If you have not done this yet, follow the multiplatform tracking guide first

  • Access to your Google Tag Manager container or your website's source code, depending on your chosen install method

  • The Lunio Conversion Tracking.tpl file, click to download if you plan to use the GTM template method

⚠️ You must be an account admin in Lunio to access the Conversions section and generate your Conversion ID.


Step 1) Generate Your Conversion in Lunio

In your Lunio dashboard, go to System Settings, click Integrations in the sidebar, then select Conversions.

Conversions section under System Settings then Integrations in the Lunio dashboard

  1. Click Create conversion and give it a name for easy reference, such as the conversion type or the relevant domain.

  2. Set the conversion type and choose whether you want Lunio to whitelist converting IPs or just track them.

  3. Enable the Parameter option if you want to pass values on the conversion event, such as an order ID.

    Create conversion dialog showing the name, conversion type and parameter options
  4. Click Generate to confirm your settings and create the conversion, which will now appear in the Conversions table.

  5. Click View in the Script column, then copy the Conversion ID shown, for example fff4eea5-079d-44a2-b861-99285cba77b3, as you will need it when configuring your tag.

    Conversion ID shown in the Script panel of the Conversions table

Step 2) Choose Your Install Method

Lunio gives you two ways to install conversion tracking and both capture exactly the same conversion and attribution data, so the right choice comes down to how your website is managed.

  • Method A: Google Tag Manager template is the recommended option if you use GTM, as you map your data through a simple field interface rather than editing any code.

  • Method B: Install directly on your website suits anyone who would rather place or fire the script themselves, which gives you full control over how and when the conversion fires.

Whichever you choose, you will work with the same set of fields, which are listed in Conversion and Attribution Fields at the end of this guide.


Method A: Google Tag Manager Template

This method uses Lunio's pre configured tag template rather than a manual custom HTML tag, which means you can map your conversion and platform data through a simple field interface instead of editing code.

Import the Lunio template

  1. In GTM, click Templates in the left hand menu, then under Tag Templates click New.

  2. Click the three dot menu in the top right, select Import, upload the template file downloaded at the beginning of the guide, then click Save so the template is available when creating tags.

Configure the tag

  1. Go to Tags, click New, then click Tag Configuration and select the Lunio Conversion Tracking template from the Custom section.

  2. Choose your Conversion Type. Selecting Purchase reveals the conversion data fields, whereas selecting Lead hides them, as a lead does not carry a value or order reference.

  3. Paste your Conversion ID into the Conversion ID field.

  4. Under Ad Platforms, tick the platforms you advertise on so that only the relevant platform sections expand, which keeps the tag tidy and avoids mapping fields you do not need.

Map your fields

Map your data layer variables to each field shown, using the tables in Conversion and Attribution Fields below. You only need to map the fields for the platforms you ticked.

💡 Most of these values come from your data layer or your ad platform's auto tagging, so whoever manages your GTM setup can confirm which variables are available.

Set your trigger

Click Triggering, then click + and set up a trigger that fires when a conversion is completed, for example a Page View trigger set to fire when the URL contains /order-confirmation, then save the trigger.

Test and publish

  1. Click Preview in GTM, enter your website URL and complete a test conversion, then check the GTM Preview panel confirms the Lunio Conversion Tracking tag shows as Fired.

  2. Click Submit, add a version name such as Added Lunio conversion tracking, then click Publish.

Verify your setup

Complete a real conversion on your website, then check System Settings → Integrations → Conversions in your Lunio dashboard to confirm the conversion has been received. If nothing appears within a few minutes, use the GTM Preview panel to confirm the tag is firing on your conversion page.

💡 This method works with web (client side) GTM containers only, so if you are using a server side GTM container, see the server side GTM setup guide instead.


Method B: Install Directly on Your Website

This method captures exactly the same conversion and attribution data as the GTM method, the difference being that you populate the values yourself in the code rather than mapping them through template fields, which gives you full control over how and when the conversion fires. This suits anyone who would rather handle the script directly, whether that means placing it on a page, firing it through another tag manager, or triggering it from your own code after a custom event.

Add the script

  1. In the Conversions table, click View in the Script column and copy the full script, which comes pre filled with your Conversion ID.

  2. Place the script wherever the conversion should fire, for example just before the closing </body> tag on the success page a user reaches after a purchase or form submission.

Fill in your values

Replace the placeholder values with your real conversion and attribution values, pulling them from wherever your site exposes them. These are the same fields described in Conversion and Attribution Fields below, so fill in the ones that apply to the platforms you advertise on. A filled in script looks like the example below, which passes a Conversion ID, an order ID and value, and a Google click ID, with the remaining platform fields left as null.

window.LunioTrackConversion('fff4eea5-079d-44a2-b861-99285cba77b3', {
  order_id: 123,
  conversion_value: 49.99,
  currency: 'GBP',
  product_id: null
}, {
  google_gclid: 'EAIaIQobChM...',
  google_campaign_id: null,
  // remaining platform fields follow the same pattern, left as null where unused
  placement_id: null
});

⚠️ Leave any field you are not using as null rather than deleting it or leaving it blank, as the script expects every field to be present even when it has no value.

Publish your changes

Publish your changes to make them live.

Verify your setup

Complete a real conversion and then check System Settings → Integrations → Conversions in your Lunio dashboard to confirm the conversion has been received. If nothing appears within a few minutes, use your browser's developer tools to check the script is firing where you expect and that no errors are showing in the console.


Conversion and Attribution Fields

Both install methods use the same fields. In Method A you map them to your data layer variables, and in Method B you fill them in directly in the script. Map or fill only the fields that apply to the platforms you advertise on.

Conversion data fields (Purchase only)

These fields appear when the conversion type is set to Purchase and let you pass the details of the sale to Lunio.

Field

What to map to it

order_id

Your unique order or transaction reference, which helps Lunio match conversions to individual orders

conversion_value

The monetary value of the purchase

currency

The currency code for that value, for example GBP or USD

product_id

The product reference, if you track conversions at product level

Ad platform fields

When someone clicks one of your ads, the platform appends a click ID to the destination URL, which lets Lunio tie a conversion back to the click that caused it. Each platform can also pass campaign details such as the campaign or ad group the click came from. These values typically live in your data layer or are populated by the platform's auto tagging, so in most cases you are mapping variables that already exist rather than creating new ones.

Platform

Field

What to map to it

Google

google_gclid

The Google click ID, the unique identifier Google adds to your ad URLs

Google

google_campaign_id

The ID of the campaign the click came from

Google

google_adgroup_id

The ID of the ad group within that campaign

Google

google_keyword

The keyword that triggered the ad

Google

google_match_type

How the keyword was matched, such as broad, phrase or exact

Google

google_network

The network the click came from, such as search or display

Meta

meta_fbclid

The Meta (Facebook) click ID added to your ad URLs

Meta

meta_campaign_id

The ID of the campaign the click came from

Meta

meta_ad_set_id

The ID of the ad set within that campaign

Meta

meta_ad_id

The ID of the individual ad

LinkedIn

li_fat_id

The LinkedIn click ID added to your ad URLs

LinkedIn

linkedin_campaign_group_id

The ID of the campaign group the click came from

LinkedIn

linkedin_campaign_id

The ID of the campaign within that group

LinkedIn

linkedin_creative_id

The ID of the individual creative

TikTok

tiktok_ttclid

The TikTok click ID added to your ad URLs

TikTok

tiktok_campaign_id

The ID of the campaign the click came from

TikTok

tiktok_adgroup_id

The ID of the ad group within that campaign

TikTok

tiktok_ad_id

The ID of the individual ad

Microsoft (Bing)

microsoft_msclkid

The Microsoft click ID added to your ad URLs

Microsoft (Bing)

microsoft_campaign_id

The ID of the campaign the click came from

Microsoft (Bing)

microsoft_adgroup_id

The ID of the ad group within that campaign

Microsoft (Bing)

microsoft_ad_id

The ID of the individual ad

X (Twitter)

twitter_twclid

The X (Twitter) click ID added to your ad URLs

X (Twitter)

twitter_campaign_id

The ID of the campaign the click came from

X (Twitter)

twitter_adgroup_id

The ID of the ad group within that campaign

X (Twitter)

twitter_ad_id

The ID of the individual ad

Pinterest

pinterest_epik

The Pinterest click ID added to your ad URLs

Reddit

reddit_rdt_cid

The Reddit click ID added to your ad URLs

Reddit

reddit_campaign_id

The ID of the campaign the click came from

Reddit

reddit_adgroup_id

The ID of the ad group within that campaign

Reddit

reddit_ad_id

The ID of the individual ad

DV360

dv360_dclid

The DV360 click ID added to your ad URLs

DV360

dv360_campaign_id

The ID of the campaign the click came from

DV360

dv360_insertion_order_id

The ID of the insertion order the campaign sits under

DV360

dv360_line_item_id

The ID of the line item within that insertion order

DV360

dv360_creative_id

The ID of the individual creative

Taboola

taboola_tblci

The Taboola click ID added to your ad URLs

Taboola

taboola_campaign_id

The ID of the campaign the click came from

Taboola

taboola_campaign_item_id

The ID of the campaign item within that campaign

A placement_id field is also available and applies across platforms, so map it if you pass a placement reference and want that detail included.


If you run into any issues, please reach out to your account manager or email [email protected] and we will be happy to help.

Did this answer your question?