Support

Installing Madlitics using Google Tag Manager

How to install custom code snippets to your site using GTM

Google Tag Manager (GTM) is one of the easiest ways to manage third-party code on your website — no editing theme files, no digging into plugin settings, no hassle.

With GTM, you control all your tracking scripts from a single dashboard. That means faster updates, cleaner code, and less risk of breaking your site.

When you pair Madlitics with GTM, you unlock clean, first-party attribution data that flows directly into your CRM and marketing tools — even if a visitor returns days later. Paid Search, Organic Social, Email — all captured automatically, right from the first visit.

We’ll walk you through how to install tracking code on your site using GTM, focusing on the Madlitics snippet for attribution.

Prerequisite: Before you can install Madlitics, you’ll need to create a Madlitics account. Registration unlocks your dashboard, and copy the code snippet that powers attribution. This step only takes a minute and ensures you have everything ready before moving on to the platform-specific setup.

Step 1. Create your Madlitics account
Sign up for a free trial on the Madlitics website to get started. Creating an account unlocks your dashboard, where you’ll manage your sites, view analytics, and access the code snippet you’ll need to install.


Start by signing up for a free Madlitics trial to begin capturing attribution data.


Fill out the registration form to create your account and unlock your dashboard

Step 2: Access your installation snippet
Once you’ve registered and logged in, you’ll land in your dashboard’s Get Started section. Here, you’ll find your unique Madlitics installation snippet, which is required to enable tracking on your site.


Locate your unique installation snippet in the dashboard under Get Started › Step 1 › Copy Code Snippet.

Setup Google Tag Manager account  

Before you can start adding tags to your website, you’ll need to set up a Google Tag Manager (GTM) account. Think of your GTM account as the main container for all your tags — including the Madlitics snippet — and the control center for everything tracking-related across your site. If you're just getting started, this step only takes a few minutes and doesn’t require any code.

Step 1: Create account
Head over to tagmanager.google.com, sign in with your Google account, and click Create Account from the top-right corner of the Accounts dashboard.

Visit tagmanager.google.com, sign in, and click “Create Account” to begin setup.

Fill in your account and container details, then choose “Web” as your platform and hit Create.


Step 2: Setup account
Enter your Account Name (usually your company or brand name), choose your country, and optionally enable data sharing to contribute anonymized usage info to Google. Under Container Setup, give your container a name — typically your website’s domain — and select Web as the target platform. Once complete, click Create, accept the Terms of Service, and you’re in.

Complete account setup by agreeing to the ToS


Once your container is created, you’ll land in the GTM workspace — and from here, you’ll be able to add and manage your tags without editing your site’s code.

Create a new tag in Google Tag Manager

Now that your GTM container is set up, it’s time to add any necessary code snippet(s) as a new tag. Let's walk through how to create a new tag, paste in your code snippet(s) (ie. Madlitics code), and make sure it runs across every page of your website.

Step 1: Create a tag
In your GTM workspace, navigate to Tags from the left-hand sidebar, or simply click the New Tag link in your workspace dashboard. This opens up the Tags screen, where you’ll be able to create and manage all your tracking tags. Click the New button in the top right to create your first tag.

Open the “Tags” section from the sidebar or workspace

Click “New” to start building your tag


Step 2: Name and configure your tag
You’ll be taken to the Tag Editor screen. Start by naming your tag something clear, 'Madlitics' works well if you're adding our code. Next, click on the Tag Configuration box. This opens the configuration menu where you’ll choose what kind of tag you’re creating. You’ll set this to Custom HTML in the next step, but for now you’ve officially begun setup.

Name your tag, and open tag configuration sidebar

Choose “Custom HTML” from the list of tag types.


Step 3: Add the code snippet (ie. Madlitics) and set a trigger
Now that your tag is created and configured as a Custom HTML tag, it’s time to paste in the actual code and tell GTM when the tag should run.

Start by pasting your code snippet, for our purposes the Madlitics snippet (↗) into the HTML field. This small line of code ensures GTM can capture attribution data like Paid Search, Organic Social, and Email and pass it into your CRM or other marketing tools.

After pasting your code, click into the Triggering box to set the conditions for when this tag should fire. For most use cases, choose All Pages — this ensures your tag loads on every page of your website, giving Madlitics complete visibility into how visitors arrived, even if they return days later.

When everything looks good, hit Save in the top-right corner to finalize the tag setup.

Paste your code snippet directly into the Custom HTML field.

Click the “Triggering” box to choose when the code should run.

Select “All Pages” to make sure the Madlitics code fires on every page of your site.

Once everything’s in place, click “Save” to complete your tag configuration.

Step 4: Save and publish your tag
This final step is where Google Tag Manager applies your changes to the live version of your site. Let’s walk through the process. Back to the Tags screen, and in the upper-right corner, click the blue Submit button to begin the publishing process. This tells Google Tag Manager you’re ready to push your tag live.

Click the Submit button in the top-right corner to start publishing your tag.

On the Submission Configuration screen, give this version a clear name like 'Madlitics Custom Snippet'. Adding a version name helps you track changes later on, especially if you’re managing multiple tags. You can also include an optional description to remind your future self or teammates what this version contains. Make sure the option Publish and Create Version is selected at the top of the screen. Then, click the Publish button to save and activate your tag.

Enter a name and description for your tag.

After clicking Publish, GTM redirects you to the Version Summary screen. This shows you that your new tag is now active and lists what changed in the container. You should see your new tag with your custom label name (ex. “Madlitics”) — listed under “Version Changes.”

You’ll see a confirmation message and a summary of your newly published tag.

Install the Google Tag Manager plugin and connecting to WordPress

To complete the setup, you’ll need to install a WordPress plugin that embeds your Google Tag Manager container across your entire site. This makes sure that the Madlitics snippet — and any other tags you’ve added — can actually run. We’ll be using the popular GTM4WP plugin, short for Google Tag Manager for WordPress.

Step 1: Create a tag
In your WordPress dashboard, navigate to Plugins → Add New, and search for “GTM4WP.” You’re looking for the plugin titled “Google Tag Manager for WordPress” by Thomas Geiger. Click Install, then Activate. Once the plugin is activated, go to Settings → Google Tag Manager in your WordPress sidebar. This will open up the configuration screen where you’ll paste in your GTM ID.

Search for “GTM4WP” in the plugin directory and install Google Tag Manager for WordPress.

After activating the plugin, head to Settings → Google Tag Manager to open the configuration page.

Step 2: Add your GTM container ID
In your Google Tag Manager dashboard, you’ll find your Container ID in the top-right corner — it starts with GTM-. Copy that ID and paste it into the Google Tag Manager ID field in your plugin settings. Leave the other default options unless you know you need to change them. When you're done, click Save Changes.

Paste your GTM Container ID (e.g. GTM-XXXXXXX) into the plugin settings and save your changes.

Madlitics multi-channel attribution visualization, showing marketing platforms like TikTok, Instagram, Google, and Facebook. The graphic highlights how different sources contribute to high-performing marketing channels.
1. Add UTM parameters to all inbound links
Any marketing effort that drives traffic — whether it’s a paid ad, an email campaign, or an organic post — should have properly structured URLs that clearly define the visitor’s origin. Setting it up is a straightforward process that starts with ensuring all inbound links include UTM parameters.

A LinkedIn campaign, for example, might link to:
https://yoursite.com/?utm_source=linkedin&utm_medium=paidsocial&utm_campaign=q1_promo
Screenshot of a form builder interface with a highlighted 'Hidden Input' field. Accompanied by text explaining how to install and set up Madlitics by adding hidden fields to capture marketing attribution data.
2. Add hidden fields
Once you’ve added UTM tracking to your inbound links, the next step is to install Madlitics on your site and update your Framer Forms to include hidden fields that will store attribution data when a visitor submits a form automatically. Hidden fields to include:
• Channel (e.g., Paid Search, Organic Social, Direct)
• Segment 1 (Platform name: Google, LinkedIn, Twitter)
• Segment 2 (Campaign name)
• Segment 3 (Ad group, offer name, or post type)
• Segment 4 (Creative type or ad variation)
• Landing page/group (Tracking & first-touch attribution)
CRM interface showing a detailed view of captured attribution data, including marketing channels, segments, and landing pages. A business profile of a lead is displayed, highlighting how Madlitics enriches lead data for sales and marketing teams.
3. Utilize attribution data
With the setup complete, every form submission in Framer now carries full attribution data, ensuring accurate insights into where leads originate. Pass this data to your CRM, analytics tools, or marketing automation platforms to track performance, refine campaigns, and optimize marketing efforts with precision.

Installing Madlitics through Google Tag Manager is one of the cleanest, most reliable ways to ensure your attribution data is captured accurately from day one. Whether you’re working with a WordPress site or any modern CMS, GTM gives you a centralized, flexible way to manage scripts without touching code — and when paired with Madlitics, you gain full visibility into how leads are finding your business.

Now that your container is live and your Madlitics tag is active, you’re set up to start collecting first-party attribution data across every session and touchpoint.

Need help verifying everything’s working? Check out our Testing Guide to make sure your tag is firing correctly. And if you ever get stuck, reach out to our team — we’re here to help.

Put attribution data to work
Sync, analyze, and automate — turn insights into action.
Automation icon indicating hands-free marketing attribution and data flow.
Sync with your CRM
Pass UTM parameters into Salesforce, HubSpot, or ActiveCampaign so your sales team knows exactly where every lead came from — no more guessing.
Analytics report icon, indicating data insights and reporting.
Built smarter reports
Use Google Sheets, Looker Studio, or Airtable to create data-driven reports that reveal which campaigns drive real revenue — helping you make informed budget decisions.
Impact measurement icon, symbolizing marketing effectiveness.
Track revenue impact
Sync UTM data with Stripe, PayPal, or Chargebee to see which campaigns generate paying customers, not just leads — so you can scale what works.
Personalization icon, representing customization features.
Personalize email campaigns
Trigger personalized email flows in Klaviyo, Mailchimp, or ConvertKit based on a lead’s original source — ensuring the right message reaches the right audience.
Visualizing your marketing impact
See how attribution data translates into actionable insights.
Stacked bar chart showing lead generation by marketing channel over time, comparing sources like Paid Search, Paid Social, Organic Search, Direct, and Email. Helps visualize which channels drive the most traffic.
Leads by channel
See how different marketing channels contribute to lead generation over time. Understand which ones drive the most traffic and whether your marketing mix is balanced. Shift your budget toward the highest-performing channels to maximize results.
Stacked bar chart illustrating lead volume across different marketing campaigns, including Black Friday, Retargeted, Spring Promo, Referral, and SEO. Highlights trends in campaign effectiveness.
Leads by campaign
Track inbound leads across all campaigns, whether or not they have UTM parameters. Ensure every lead is categorized correctly, including Organic and Referral traffic. Use this insight to refine messaging, targeting, and budget allocation for better performance.
Line chart displaying lead-to-customer conversion rates by channel, comparing Google Ads, Facebook Ads, LinkedIn Ads, Organic Search, and Email. Shows how different sources drive qualified leads over time.
Conversion rate by channel
See which channels convert leads into paying customers. Some bring buyers, while others generate unqualified leads. Focus your budget on what drives revenue.
Line chart showing revenue performance by marketing campaign, comparing Google Ads, Facebook Ads, and LinkedIn Ads. Helps identify top-performing and underperforming campaigns.
Revenue by campaign
Focus your budget on campaigns that drive revenue, not just leads. Identify top performers and optimize underperforming efforts to maximize profitability.
Everything you need for reliable lead attribution
Accurate, persistent, and automated tracking — so your campaigns perform at their best.
Performance icon symbolizing marketing campaign effectiveness and results tracking.
Outperforms basic UTM tracking
Madlitics captures, categorizes, and persists attribution data across sessions, giving you a complete, structured view of what’s working in your marketing. Say goodbye to losing attribution when users navigate your site, struggling with formatting inconsistencies, and ingored non-UTM traffic.
Capture icon indicating data collection from various marketing channels and sources.
Capture all traffic
Madlitics categorizes all inbound leads — whether they have UTM parameters or not — so every conversion is accounted for, and you won't miss out on Organic Search, Organic Social, and Referral traffic.
Routing icon representing the flow of marketing data and attribution pathways.
Attribution across pages and sessions
A LinkedIn ad click should be attributed correctly—even if the visitor signs up on a different page later. If someone clicks an ad, browses multiple pages, then submits a form later, Madlitics persists attribution data across sessions, ensuring your reports reflect true performance.
List icon representing structured marketing data, reports, or campaign breakdowns.
Cleaner, more reliable data
Duplicate UTMs and inconsistent formatting break reports and mislead teams. Madlitics cleans and organizes attribution data before sending it to your CRM, giving you accurate insights.
Target icon symbolizing precise audience targeting and marketing campaign focus
See which content converts
Attribution isn’t just about where visitors came from—it’s about what convinced them to convert. By capturing landing page data alongside UTM parameters, Madlitics shows you which blog posts, case studies, or pricing pages drive the most revenue, helping you scale content that works.
Action icon representing campaign execution, optimization, and engagement.
Transform form submissions into actionable insights
Madlitics connects marketing touchpoints to lead generation, ensuring every form submission is fully attributed — optimize ad spend by identifying high-ROI channels, refine messaging based on what content drives engagement, make data-driven decisions with clean, structured reports, and more.