Skip to main content

Setting up the Lunio Conversion API with Server-side Google Tag Manager

Updated yesterday

This guide walks you through setting up Lunio conversion tracking using the Lunio Conversion API template in a server-side Google Tag Manager (sGTM) container.

If you haven't set up server-side GTM yet, you'll need to do that before following this guide. For an overview of the Lunio Conversion API and alternative setup methods, see the Conversion API overview.


Before You Start

Before getting started, make sure you have:

  • A server-side Google Tag Manager container set up and running

  • Access to your Lunio dashboard

  • The Lunio sGTM template .tpl file (contact your Lunio account manager to request this)

  • GTM variables configured for user IP and user agent in your sGTM container


Step 1 — Get your Lunio credentials

Head to System Settings > Integrations > Conversions in your Lunio dashboard and click Create conversion to set up your conversion event. Once created, copy your API Token and Config ID as you will need these when configuring the tag.


Step 2 — Import the Lunio template into sGTM

  1. In your server-side GTM container, go to Templates in the left hand menu

  2. Under Tag Templates, click New

  3. Click the three dot menu (top right) and select Import

  4. Upload the .tpl file provided by your account manager

  5. Click Save

The template will now be available when creating tags.


Step 3 — Create the conversion tag in sGTM

  1. Go to Tags then New

  2. Click Tag Configuration and select Lunio Conversion API Template from the Custom section

  3. Fill in the following fields:

Field

Required

What to enter

Endpoint URL

Yes

The Lunio Conversion API endpoint, provided with the template

API Token

Yes

Your Bearer token from the Lunio dashboard

Config ID

Yes

The Config ID copied from the Lunio dashboard

User Agent

Yes

Map to your sGTM variable that captures the user's browser user-agent

User IP

Yes

Map to your sGTM variable that captures the end user's IP address

Order ID

No

Optional. Map to your order ID variable if you want to pass order values

Note: When using sGTM, the X-Forwarded-For header is set automatically so you do not need to configure this manually.


Step 4 — Set your trigger

The tag needs to fire when a conversion is completed.

  1. Click Triggering in the tag setup

  2. Click + to add a trigger

  3. Set this up to fire on your conversion event, for example a custom event that fires on your purchase confirmation page

  4. Save the trigger


Step 5 — Test and publish

Before publishing it is worth testing to make sure everything is working correctly.

  1. Click Preview in sGTM

  2. Complete a test conversion on your website

  3. Check the sGTM Preview panel to confirm the Lunio Conversion API Template tag shows as Fired

  4. Verify the event is being received in Lunio

  5. Publish the changes to your workspace


Notes

  • This template is for server-side GTM containers only. If you are using a web (client-side) GTM container, see the client-side GTM conversion tracking guide instead.

  • The X-Forwarded-For header is handled automatically by sGTM so you don't need to set this manually.

  • For help or questions, please don't hesitate to reach out to your account manager or email to [email protected].

Did this answer your question?