Resource Center

Tracking : Partnerize Google Tag Manager Integration

_________________________________________________________________________________

 

This article will review:

  • How the Partnerize Google Tag Manager Integration functions
  • What tracking features are included
  • How to install and implement the templates
  • Access to additional technical documentation

_________________________________________________________________________________

Index

_________________________________________________________________________________________

Overview

Partnerize has a template for Google Tag Manager (GTM) which allows brands to easily integrate their conversion tracking using pre-built tracking tags into GTM.  

This template uses a 1st party cookie tracking solution via a Partnerize Click Reference (clickref). This ensures that the brand’s tracking is not reliant on 3rd party cookies, and is therefore ITP (and equivalent) compliant.  

The template also automatically reads the GTM dataLayer to easily format the data, to be able to send it to Partnerize for purchase tracking, which reduces the need for any complex integration and development work.

__________________________________________________________________________________________________

Cookie Consent

Partnerize's first party tracking rely on a click ID (clickref) being stored either client or server side as a 1st party cookie. If the clickref isn't stored, then in most cases, Partnerize is unable to attribute the conversion to a click and the sale won't be attributed.

Partnerize cannot provide legal advice on whether and in what cases the clickref cookie should be restricted for visitors who have not affirmatively consented as it is each advertiser’s responsibility to manage its own website.

However, any desired changes to cookie consent settings can easily be implemented for your Partnerize affiliate program.  Please see technical options here.

_________________________________________________________________________________

Implementation Steps

The Partnerize GTM web/client integrations requires the implementation of two templates:

  • Capture Partnerize Click Reference Template - Captures and saves the Partnerize Click Reference (clickref) from the brand’s landing pages
  • Partnerize eCommerce Tag Templates - Uses the GTM dataLayer to automatically populate Partnerize's conversion tag to track sales from confirmation page

The Partnerize S2S requires the implementation of one template:

  • Partnerize S2S (Server to Server) Tracking Tag - Handles both the client and conversion events in one template given the ease of implementation

_________________________________________________________________________________

GTM Web Based Templates

1. Capture Partnerize Click Reference Template

This template will look for, capture, and save the Partnerize Click Reference (clickref) from the brands landing pages. The clickref will then be automatically retrieved at point of purchase and added to the conversion tracking pixel, which provides a 1st party cookie tracking solution.  This tag MUST be deployed on all possible landing pages.

1.1 Import Capture Click Reference Template

  • Navigate to the “Templates” section of Google Tag Manager
  • Click on “Search Gallery” to open the Template Gallery section
  • Search for “Partnerize” in the search box and all Partnerize templates will appear
  • Click on the “Capture Partnerize Click Reference” template, and a window will transition in, allowing it to be added to the current Workplace. Click on “Add to workplace”
  • On the screen that appears, the user will see a confirmation window which provides information about the permission the template will require and all it will access

1.2 Click Reference Template Permissions

Screenshot_2021-02-19_at_14.45.55.png

These are the required permissions for the template to be added:

  • Logs to console - This allows the template to put output in the developer console of the window while in preview mode. This will allow for easier debugging if the client runs into issues. It will output the full pixel url along with the data parameters being sent into it.
  • Reads URL - This allows the template to access the landing page URL to retrieve the clickref
  • Accesses local storage - This allows the template the access local storage to set and retrieve data from the current browser’s local storage.  

Click on the “Add” button to add the template to the current Workplace.

 

1.3 Set Up Click Reference Tag

The user will now be able to use the template to implement the tag and the triggering rules.

  • Click on the “Tags” link in the left pane
  • Click “New” to create a new tag: 

Screenshot_2021-02-19_at_14.49.02.png

  • A new window will appear.  Click “Tag Configuration”
  • Another new window will appear.  Locate and choose the ‘Capture Partnerize Click Reference’ template previously installed
  • Click “Triggering” and set the firing rules to trigger on “All Pages”:

Screenshot_2021-02-19_at_14.49.40.png

  • Click “Save” to save changes
  • Click “Submit” to commit the changes:

Screenshot_2021-02-19_at_14.50.35.png

________________________________________________________________________________________

2. Partnerize Web eCommerce Conversion Templates

Partnerize offers a range of GTM conversion templates depending on the brand's dataLayer structure (providing the dataLayer adheres to Google's recommended structure)

  • Partnerize GA4 eCommerce Tag :   Uses the GA4 dataLayer format as specified here
  • Partnerize Enhanced eCommerce Tag :  Uses the Enhanced dataLayer format as specified here
  • Partnerize Standard eCommerce Tag  : Uses the Standard dataLayer format here

The purpose of all templates is to send transactional data from the brand's website to Partnerize.It automatically reads all transactional data from the eCommerce dataLayer within GTM, to populate the Partnerize tracking pixel. The templates works in conjunction with the Partnerize Click Reference template to retrieve the clickref stored in the current browser’s local storage / 1st party cookie thus mitigating risks of 3rd party cookie reliance.  This tag should be deployed on confirmation event pages where the brand wants to send the transaction data to Partnerize.

 

2.1 How to import web eCommerce Templates

  • Navigate to the “Templates” section of Google Tag Manager
  • Click on “Search Gallery” to open the Template Gallery section
  • Search for “Partnerize” in the search box and all Partnerize templates will appear
  • Select template that matches your dataLayer, and a window will transition in, allowing it to be added to the current Workplace. Click on “Add to workplace”
  • On the screen that appears, the user will see a confirmation window which provides information about the permissions the template will require and all it will access

 

 

 

NOTE:

  • Since this tag is based on the usage of Google Tag Manager’s “dataLayer” the pixel should not fire until this “dataLayer” is ready and populated. This may not be when the page first loads.
  • If brand's dataLayer does not match Google's recommended structure Partnerize's templates will not be compatible and tracking may not work
    • This may require a custom Template so please contact team

 

2.2 eCommerce Permissions

Once templates are imported these are the required permissions :

  • Logs to console - This allows the template to put output in the developer console of the window while in preview mode. This will allow for easier debugging if the client runs into issues. It will output the full pixel url along with the data parameters being sent into it.
  • Sends Pixels - This allows the pixels that fire upon confirmation to be sent to Partnerize
  • Reads Data Layer - This is required to get the ecommerce data from the dataLayer and populate it into the tag
  • Accesses local storage - This allows the template the access local storage to set and retrieve data from a 1st party cookie

Click on the “Add” button to add the template to the current Workplace.

 

2.3 Set Up eCommerce Tag

The user will now be able to use the template to implement the tag and the triggering rules.

  • Click on the “Tags” link in the left pane
  • Click “New” to create a new tag
  • A new window will appear.  Click “Tag Configuration”
  • Another new window will appear.  Locate and choose the appropriate Template installed (E.g “Partnerize Enhanced eCommerce Tag”) 
  • The tag can then be configured:

Screenshot_2021-02-19_at_14.52.17.png

  • Enter the campaign ID - This will need to be provided by the Partnerize Integrations team
  • Enable the voucher code parameter, if required
  • Custom conversion level parameters can also be added by clicking on the “Add Row” button. This will show a table view to provide a parameter and value
    • These could be parameters/values that are NOT part of the dataLayer that the brand wants to include (i.e. anything stored in Google Analytics / any hard coded values / etc.)
  • Otherwise, the template code automatically reads the data from the dataLayer and populates the relevant parameters in the Partnerize pixel, and formats the pixel correctly.
  • For example, the highlighted code below reads the value from the ecom.purchase.actionField.id variable from the dataLayer, and passes that into the Partnerize “conversionref” parameter:

Screenshot_2021-02-19_at_14.54.17.png

  • The brand could customize the above code as much as necessary.  For example:
    • i.e. rather than referencing ecom.purchase.actionField.id for their order ID / conversionref, update this code to reference the correct parameter from their dataLayer
    • Omit certain variables from the Partnerize pixel, by commenting out the relevant lines of code
    • Change parameter names by updating the code above
    • If the brand IS NOT using the 'Enhanced eCommerce' dataLayer on their site, they could still use the code template above but change the code where necessary to reference their own Data Layer
    • If there is data available which is not directly within the dataLayer, this can be added to the tag using the ‘Add Row’ feature within Tag Configuration, and entering the required parameter name and variable.
  • The above code can be accessed within the Tag Templates section GTM, under Template Editor

_______________________________________________________

GTM Server Based Template

1. Partnerize S2S Tag Template

This tag is to be used when you are using Google Tag Manager server based deployment.

1.1 Import Partnerize S2S Template

  • Navigate to the “Templates” section of Google Tag Manager
  • Click on “Search Gallery” to open the Template Gallery section
  • Search for “Partnerize” in the search box and all Partnerize templates will appear
  • Click on the “Partnerize S2S” template, and a window will transition in, allowing it to be added to the current Workplace. Click on “Add to workplace”
  • On the screen that appears, the user will see a confirmation window which provides information about the permission the template will require and all it will access

Once done, you will need to configure the data in 2 new "Tag" configurations in their workspace. Here is an example showing they both use the same template:

The configurations are different, and the template will guide you through the configuration of both.

 

1.2 Set up Click Tag

This tag should be "PageView" as the type, as we want this to fire on all landing pages when the page loads. It allows you to specify the length of the httpOnly cookie that gets created, as well as which URL parameter to look for the click_reference in. This will create the usual "partnerizeClickReference" cookie with the life-span set here. We have to allow the user to select the length of time, as per the requirements at the time of this writing. This should fire on all pages, and take into consideration any conditional logic the client would have (cookie consent, attribution, etc.)

 

1.3 Set up Conversion Tag

We will need the conversion data sent to us, so another tag must be created for this. As you can see from the above, this looks familiar. The client has to set their Campaign ID, and the rest is optional. If they have items, provide the "Variable" that contains the items, and we will perform the standard mapping options:

for (const property in product) {
    switch (property) {
        case 'currency':
            break;
 
        case 'sku':
        case 'id':
        case 'item_id':
        case 'item_sku':
            requestUrl += '/sku:' + enc(data.itemArray[i][property]);
            break;
 
        case 'category':
        case 'item_category':
            requestUrl += '/category:' + enc(data.itemArray[i][property]);
            break;
 
        case 'price':
            requestUrl += '/value:' + enc(data.itemArray[i][property]);
            break;
 
        default:
            requestUrl += '/' + formatParameter(property) + ':' + enc(data.itemArray[i][property]);
            break;
    }
}

As you can see, we have included all standard variations of SKU and CATEGORY that GTM suggests. We run the traditional parameter sanitization and value encoding for URL handling. We then make the HTTP call to Partnerize:

sendHttpRequest(requestUrl, (statusCode, headers, body) => {
    if (isLoggingEnabled) {
        logToConsole(JSON.stringify({
            'Name': 'Partnerize',
            'Type': 'Response',
            'TraceId': traceId,
            'EventName': data.eventName,
            'ResponseStatusCode': statusCode,
            'ResponseHeaders': headers,
            'ResponseBody': body,
        }));
    }
 
    if (statusCode >= 200 && statusCode < 300) {
        data.gtmOnSuccess();
    } else {
        data.gtmOnFailure();
    }
}, {headers: requestHeaders, method: 'GET'});

________________________________________________________________________________________

Adding Additional Conversion Parameters

1. Country Tracking

Partnerize allows global brands the ability to track the “country” of purchase.  This is extremely beneficial to identify which market generates the most spends and report back within the Partnerize platform. 

Within Tag Configuration section 

  • Add Row
  • “Parameter Name” with be mapped to “country” 
  • “Parameter Value” will be mapped to the client variable that contains country value ( if available )
  • Save

 

NOTE:

  • The country code must conform to the ISO 3166 two letter country code (eg. GB, US)
  • If there are other variables to include repeat the above steps and map the “Parameter Name” with corresponding “Parameter Value”

Screenshot_2021-02-19_at_14.56.04.png

 

2. Currency Tracking

For each point of sale/campaign, it is important to confirm how many currency variations will be provided in the 'currency' parameter for tracked sales:

  • Track sales in one currency only (i.e. all sales will track in GBP)
  • Track sales in multiple currencies (i.e. sales could track in GBP, EUR and USD)

This should be discussed with the Partnerize Integration team during the Implementation phase.

_________________________________________________________________________________

Conversion Tag Triggering Events

1. Basic Configuration

  • The brand will need to set up the trigger condition for when GTM should fire the Partnerize pixel.  This should be configured based on the event for which they want to pass sale data to Partnerize
  • The example trigger below would fire the pixel whenever the 'completeCheckout' event occurs:
  • Click “Save” to save changes
  • Click “Submit” to commit the changes:

Screenshot_2021-02-19_at_14.56.52.png

 

NOTE: This GTM cache busting feature should not be enabled for the Partnerize integration.  To check if this is enabled, or to disable it:

  • Navigate to Tag Configuration
  • If checked, disable ‘Enable Cache Busting’
  • Click Submit and Publish the changes

2. When to Trigger GTM / Exclusive Codes

The GTM conversion should be triggered at point of checkout and typically when a "clickref" value is present. If a brand wishes to utilise Partnerize's exclusive code functionality https://help.phgsupport.com/hc/en-us/articles/4405844671377 it is essential that vouchers are passed into the 'voucher' parameter.

 

Exclusive Codes also introduces the concept of clickless tracking, allowing brands to work with non-traditional partnerships who don't work with tracking links. In order to utilize clickless tracking, a brand must trigger the tracking unconditionally for every sale regardless if a clickref value is present.

 

The "clickref" parameter can be left empty as "/clickref:/"

 

NOTE:  Even though  tracking is loaded for every sale Partnerize will only attribute sales that were referred by our partners.

_________________________________________________________________________________

Testing

Once the tags are deployed, they should be tested by submitting a test transaction via the brand’s live website.  A non session test should be performed, which simulates a returning customer who originally followed a partner link but purchased at a later date. Providing the sale is made within the cookie period of the brand, the transaction should track successfully.

Testing Instructions

  • Follow a test partner link.  To obtain a link, go to the ‘Partners’ section of the Partnerize platform, locate the ‘test’ partner account, copy the tracking link and paste it into the browser window.  Email integrations.support@partnerize.com if you cannot locate the link
  • Let browser load page
  • Once loaded, exit browser
  • Reopen browser and go directly to brand site without following test link
  • Purchase multiple items (if applicable)
  • Save order number with purchase costs
  • Provide source code from thank you page and order/transaction ID to integrations.support@partnerize.com

Expected Outcome

  • Transactions is recorded in the Partnerize dashboard
  • All parameters are populated correctly, and that the conversion call is correctly formatted.  The following parameters should be checked closely:
    • Value - Ensure that this is populated with the NET item value for each item
    • Currency - Ensure that this is populated with the correct currency used at point of sale
    • Clickref - Check that the most recent clickref has been passed into the parameter
  • Check that the tracking solution has been fired from the live confirmation page

_________________________________________________________________________________

 

Next Steps

  • Request a campaign_id from the Partnerize Integration team.  Email integrations.support@partnerize.com if you do not already have this.
  • Install the GTM templates using the instructions above.  Inform the Partnerize Integration team once this has been completed
  • Perform testing using the above instructions - Transactions will need to be submitted via the brand’s live website, so that the implementation can be fully tested.  

_________________________________________________________________________________

FAQ's

Please refer to our GTM FAQ guide here: GTM FAQ's

 

____________________________________________________________________________

 

Was this article helpful?

1 out of 1 found this helpful

Have more questions? Submit a request