Partner Ads Google Tag Manager Server-Side Conversion Tag Tutorial

Overview

 

This Tutorial will show you how to setup Partner Ads Server-Side conversion with a Google Tag Manager (GTM) container. It includes Client-Side and Server-Side code and custom template you can download and add it to your containers. If you have any questions please reach out via Upwork. 

Table of Contents

  1. Requirement to complete the guide
  2. Steps
  3. Best Practices and Recommendations

Requirement to complete the guide

  1. GTM Server-Side container installed.
  2. GTM Client-Side and Server-Side Publisher access.
  3. Partner Ads program. 
  4. A way to test conversions.
  5. A Partner Ads test URL

Steps 

1. Setup GTM Client-Side Container

  1. Create a Listener tag that catches Partner Ads ‘pacid’ and ‘paid’ URL query parameters.   To do this step, go to my Github here, copy the tag script, and add it to your Client Side Tag using a GTM Custom HTML Tag. You can name this tag, Partner Ads Listener & Cookie Tag.

    You can edit the number of days you want to store these cookies. The tag will store the cookies at the root domain level, so you can access them if the conversion happens in another subdomain. 

  2. Set an Initialization trigger for the tag above that will fire when a Page URL with the parameters ‘paid’ or ‘pacid’ is in the URL. Use a trigger condition that matches a Regular Expression so you can fire this trigger when any of these are present.
    GTM Trigger
  3. Map the two Cookies that the tag will create by going to the GTM variables section. The variable’s type should be ‘1st Party Cookie’ and you must name them ‘pacid’ and ‘paid’ accordingly.
    GTM Variable
  4. Update the  ‘pacid’ and ‘paid’ parameters in the Conversion Transport Client Side tag.

The steps above are the only ones you need from the client side. The purpose of this step is to capture and store the Click ID values in the visitor’s browser and GTM through the cookies, so you can retrieve these values in the Thank You page of the conversions and send these to the Server GTM container.

 

2. Setup GTM Server-Side Container

  1. Download my GTM Server-Side Partner Ads template that contains: the Tag Template, the Tag and the server ‘paid’ and ‘pacid’ variables.

    https://github.com/jjbernalgarcia/partner_ads/blob/main/gtm-partner-ads-server-side.json

  2. Import the JSON file in your GTM Server Side Container. Make sure you don’t overwrite the settings you have already.

    About the Partner Ads Server Tag I attached here: I created this template to send conversion data to Partner Ads API endpoint https://www.partner-ads.com/no/leadtracks2s.php?programid=[program_id]&partnerid=[paid]&pacid=[pacid]&ordreid=[order_id]&omprsalg=sale_amount&type=salg&varenummer=x&antal=1

    If you need to edit the endpoint URL, you can go to the Template section on GTM and edit it. 

  3. Add the ‘Program ID’, ‘Oder ID’ and ‘Value in the tag’. The Program ID should be provided by your Partner Ads support staff.

  4. Add the same trigger you use for the Purchase or Lead submission accordingly.
  5. Exclude the ‘paid’ and ‘pacid’ parameters in the GA4 tag if you are using the GA4 client-side tag to transport data to the server.

 

3. Test the setup of Partner Ads URL

  1. After you complete the step above, use a test URL that Partner Ads staff should provide you to test the tracking.

    In example, https://www.partner-ads.com/country/somevalue.php?partnerid=xxx&someparameter=xxxx

  2. Activate The GTM Client-Side and Server-Side Preview Mode, make sure you add the test url in the Client Side debug view.
  3. Verify that the GTM container is storing the ‘paid’ and ‘pacid’ in the cookies.
  4. Complete the conversion you want to use to pay the commission and check the Partner Ads response in the Tag debug view. You should have a 200 status response.
 

4. Publish the GTM Client-Side and Server-Side container

That’s it! You have learned how to impelement Partner Ads tracking via Server Side.

Best Practices and Recommendations

For businesses looking to implement similar systems:

– Prioritize data accuracy and integrity

– Maintain clear documentation

– Regular system audits and monitoring

– Ensure compliance with privacy regulations

 

– Ask your Partner Ads contact to verify the setup before publishing the container.

John B.

Server-Side Tracking Full-Stack developer/consultant.

About me

Hi! It’s nice to meet you! My name is John Bernal, I’m an international freelancer who offers Customer and Marketing Analytics services. 

I’m the founder of the most active Whatsapp community for Spanish speakers. 

Hire me & reviews
My background

My projects