Affiliate Tracking with Google Tag Manager
Author
glp winnerDate Published
- Twitter
- Facebook
- LinkedIn
- Instagram
- Copy Link

Introduction
Track affiliate leads and conversions for GLP Winner with this Google Tag Manager template.
This is the recommended no code integration if you use Google Tag Manager.
What You'll Need
- Your Provider ID from GLP Winner. You can leave blank if you have multiple storefronts.
- Google Tag Manager (GTM) account
Step 1: Install the GLP Winner Template
Download template.tpl from this repository.

In GTM, go to Templates → New


Click the menu (⋮) → Import. Select the downloaded template.tpl file

Save the template

Step 2: Create Initialization Tag
Go to Tags → New

Choose "GLP Winner Tracking" as tag type

- Configure:
- Tag Type: Initialize GLP SDK
- Provider ID: Your numeric Provider ID from GLP Winner (e.g., usually a two digit number). You don't need to enter this if you have multiple storefronts:

- Test Mode: Enable for testing (disable for production)
- Set trigger to "All Pages"
- Name it "GLP Winner - Initialize"
- Save

Step 3: Create Lead Tag [optional]
- Create another new tag
- Choose "GLP Winner Tracking" as tag type
- Configure: More on these fields in Step 3a.
- Tag Type: Track Lead
- Lead Email: {{dlv - Your Email Variable}} (optional)
- Lead Step: {{dlv - Funnel Step Name}} (optional)
- Load GLP Script: Uncheck (script already loaded by init tag)
- Set a trigger for your lead event. Examples:
- Email Submitted
- Get Started CTA
- A custom event fired from the data layer. More on this in Step 3a.
- Other mid-funnel triggers.
- Name it "GLP Winner - Lead"
- Save

Step 3a : Track where the user is in your funnel [optional]
We can use the Track Lead tag to determine where the user is in your funnel. The requirement is that Lead Step field needs to be filled in and unique per step in the funnel. Lead Email is technically optional:

An example of implementing this is to use a GTM custom event that fires per step in the funnel via pushing events to the data layer:
1 window.dataLayer.push({2 event: "glp_lead", // The name is arbitrary, but for this example we are calling it 'glp_lead'3 lead_step: leadStep, // 'lead_step' key is arbitrary, but we are using this as the event parameter in this example.4 user_email: userEmail, // Optional. 'user_email' key is arbitrary.5 });
You can then create a trigger for this custom event:

Don't forget to create a data layer variable for the event parameter passed through. In the example, we named the parameters lead_step and user_email:

Finally update the Track Lead tag to have the DLVs and the trigger:


Note: If you don't want to create a custom event (i.e., don't have access to the code) or don't have DLVs defined, you can just use pre-existing triggers and pass in a hardcoded value for the Lead Step. You would repeat this for every point in the funnel you want to track. Each Track Lead tag would have its own trigger and own hardcoded Lead Step value.
Step 4: Create Conversion Tag
- Create another new tag
- Choose "GLP Winner Tracking" as tag type
- Configure:
- Tag Type: Track Conversion
- User Email: {{Your Email Variable}} (optional)
- Conversion ID: {{Transaction ID}} (optional)
- Load GLP Script: Uncheck (script already loaded by init tag)
- Set a trigger for your conversion event. Examples:
- Form submissions
- Thank you pages
- Purchase completions
- Name it "GLP Winner - Conversion"
- Save

Step 4: Test
- Enable Preview mode in GTM

- Get a test UUID here.
- Visit your site with a test click ID: ?glp_click_id={{TEST_UUID}}. Should look something like yoursite.com?glp_click_id=ad130179-664f-45e8-9beb-2f2d0d9bfbed

- Check browser console (Right Click -> Inspect -> Console Tab) for:
- "GLP Winner: Initializing with config"
- "GLP Winner: Script loaded successfully"
- "GLP Winner:Tracking SDK initialized"
- "GLP Tracking Session token set: {{SOME_UUID}}"
- [optional] If you didn't put in a Provider ID in the initialization tag, you should see: "GLP SDK: Provider ID ${num} resolved from domain: ${your-provider-domain.com}"

- Complete a lead and then a conversion action.
- Verify lead and conversion logs in console:


Step 5: Publish
Don't forget to change back Test Mode to disabled in your GLP Winner - Initialize tag from Step 2.

Publish in GTM. That's it!


Here's the README if you'd like to learn more about the template. Here are resources if you'd like to explore a server-side postback solution or learn more about the Javascript SDK.


