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
.tplfile (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
In your server-side GTM container, go to Templates in the left hand menu
Under Tag Templates, click New
Click the three dot menu (top right) and select Import
Upload the
.tplfile provided by your account managerClick Save
The template will now be available when creating tags.
Step 3 — Create the conversion tag in sGTM
Go to Tags then New
Click Tag Configuration and select Lunio Conversion API Template from the Custom section
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.
Click Triggering in the tag setup
Click + to add a trigger
Set this up to fire on your conversion event, for example a custom event that fires on your purchase confirmation page
Save the trigger
Step 5 — Test and publish
Before publishing it is worth testing to make sure everything is working correctly.
Click Preview in sGTM
Complete a test conversion on your website
Check the sGTM Preview panel to confirm the Lunio Conversion API Template tag shows as Fired
Verify the event is being received in Lunio
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-Forheader 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].
