Talent.com

Postback

Talent.com Postback Implementation

What is Talent.com postback? Server postback tracking, also called “postback tracking” and “server-side tracking”, is a method of tracking conversions that uses the Talent.com server to return user conversion data.

Postback is typically implemented at the end of the application process, once the application has been submitted by the user. Postback is triggered by opening the URL provided by Talent.com.

How do I set up a postback URL from Talent.com? Postback should be set up by someone from the IT Department and should take about 30 minutes.

Postback is set up using this URL to return conversion data:

https://www.talent.com/tracker/postback.php?tracker=xxx&clickid=yyy

**The tracker= parameter will be provided by the account management team**

The value of the clickid= is added in the URL of the click that was sent and needs to be posted back to us with this parameter.

Additional features and information

Optional multi-step parameter:

  • Allows the data to post back from multiple pages. This can help track users throughout your application process. We refer to this as multi-step postback.
    • Please reach out to your account management team for more information on setting up multi-step postback.
  • For quality purposes, data must be posted back within 15 days of the trigger, or will not be counted.

Alternative technical setups

Postback implementation for tracking conversions from Talent.com can be implemented in 3 alternative ways:

Google Tag Manager

With Google Tag Manager (GTM), you can add and update customized tags and variables for conversion tracking, and specify what triggers these tags. You are going to need the postback URL from Talent.com (https://www.talent.com/tracker/postback.php?tracker=XXXXX), your last URL from the application process (example: https://www.yourwebpage.com/application-process/success) and create in GTM: two variables (clickid and tracker), one trigger (URL at the end of the application process) and two tags (one to store the clickid and another one to send it to Talent.com).

Throughout the process is essential to maintain the same name of the parameters so the code works perfectly!

Let’s see how to do it in Google Tag Manager!

1. Create the variable clickid.

  • Create a new Variable.
  • Choose a Variable Type ‘1st-Party Cookie’.
  • Write ‘PostbackValue’ in the ‘Cookie Name’ box.
  • Save the Variable as: TALENT-Variable-Clickid
Variable clickid

2. Create the variable tracker.

  • Create a new Variable.
  • Choose a Variable Type ‘Constant’.
  • Write your tracker in the ‘Value’ box. In the example we wrote ‘XXXXXX’ because we have the URL https://www.talent.com/tracker/postback.php?tracker=XXXXXX.
  • Another example: Imagine you have this URL https://www.talent.com/tracker/postback.php?tracker=company-world. In the ‘Value’ box you will write: ‘company-world’.
  • Save the Variable as: TALENT-Variable-Tracker
Variable tracker

3. Create the trigger.

  • Create a new Trigger.
  • Choose a Trigger Type ‘Page View’.
  • In ‘This trigger fires on’ section, choose ‘Some Page Views’.
  • Choose a word that only appears on your URL at the end of the application process. Imagine you have this URL: https://www.yourwebpage.com/application-process/success.
  • Set the conditions from the dropdown ‘Page URL’ - ‘contains’ - ‘success’ (we choose success because the URL from the example contains this word. Change it depending on your URL!).
  • Save the Trigger as: TALENT-Trigger-SendPostback
Talent trigger

4. Create the tag to store the clickid.

  • Create a new Tag.
  • Choose a Tag Type ‘Custom HTML’.
  • Copy the script (button below ‘Copy code to store clickid’).
  • As a Trigger, select ‘All Pages’.
  • Save the Tag as: TALENT-Tag-CreateCookie
<script type="text/javascript">
    // Get the URL from the browser
    var url = window.location.href;

    // Define the variable "clickId"
    // Attention! If you have a renamed parameter "clickid",
    // you need to change the next line as you can see in the example.
    // Example: "clickid" change to "newvalue", change the next line for
    // var clickId = extractUrlValue("newvalue", url);
    var clickId = extractUrlValue("clickid", url);

    // Check if exist the variable "clickId" and create the "PostbackValue" cookie to store the clickid value for 15 days
    if (clickId) {
        createCookie("PostbackValue", clickId, 15);
    }

    // Functions needed during the process
    function extractUrlValue(key, url) {
        if (typeof(url) === "undefined"){
            url = window.location.href;
        }
        var match = url.match("[#?&]" + key + "=([^&#]+)");
        return match ? match[1] : null;
    }
    function createCookie(name, value, days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
            var expires = "; expires=" + date.toGMTString();
        } else var expires = "";
        document.cookie = name + "=" + value + expires + "; path=/";
    }
</script>

Code to create cookieTrigger to store clickid
Note 1: We (Talent.com) can rename the clickid parameter in the URL if it is necessary for you. In this case, you can name your query key as you wish. This has to be agreed with your point of contact at Talent.

5. Create the tag to send the tracker and the clickid to Talent.com.

  • Create a new Tag.
  • Choose a Tag Type ‘Custom HTML’.
  • Copy the HTML code (button below ‘Copy code to send Postback’).
  • As a Trigger, select ‘TALENT-Trigger-SendPostback’.
  • Save the Tag as: TALENT-Tag-SendPostback
<img src="https://ca.talent.com/tracker/postback.php?tracker={{TALENT-Variable-Tracker}}&amp;clickid={{TALENT-Variable-Clickid}}" style="width: 1px; height: 1px;
">

Code to send the tracker and the clickidTrigger to send Postback data
Note 2: The parameter returned via Postback must be named clickid (&clickid=) even though you got on your side on demand a parameter with a different name (see Note 1).

Remember! All the names need to be consistent along the code. If you change the names of variables, tags, and/or trigger, you will need to make adjustments to the code.

To summarise, these are all the elements you are going to build to store the clickid and send it to Talent.com with your tracker to register a conversion in our database.

Google Tag Manager summary

JavaScript

When a job is redirect from Talent.com, you are going to have a URL with a clickid parameter at the end (https://yourcompany.com/track/?clickid=306b6v79845). To count this redirect as a conversion, you will need to store this clickid at the beginning (landing page), keep it during all the process, and send it to us when the application is completed.

For this process, we are going to need 3 variables from your side:

  • The clickid formed when a job is redirect from our page to your page. Example: https://yourcompany.com/track/?clickid=306b6v79845
  • The tracker provided by Talent.com. Example: https://www.talent.com/tracker/postback.php?tracker=XXXXXX
  • The apply_step value (optional), if you want to track when you are sending the clickid to Talent.com. Example: at the end of the application process, when click on apply, etc.

The following code snippet is meant to serve as an example of how to implement a talent postback tracker using JavaScript. Considering the intricacies of your code base, the snippet might have unintended consequences. Code must be vetted by a knowledgeable developer before being introduced into your code base.

See an example below:

Example in JavaScript

  • Include this code on the first page of the application process (landing page).
JavaScript landing page
<!DOCTYPE html>
<html>
<head>
    <script>
        // ---------------------- Write this code on the landing page ----------------------
        // STEP 1: Store the clickid in a cookie at the beginning of the application process

        // Get the URL from the browser
        var url = window.location.href;

        // Extract the clickid from the URL
        var clickid = extractUrlValue("clickid", url);

        // Check if exist the clickid and create the "clickidValue" cookie to store the clickid value for 15 days
        if (clickid) {
            createCookie("clickidValue", clickid, 15);
        }

        // Functions needed during the process
        /**
         * Function to extract a param value from a URL
         * @param {string} key Name of the param that contains the value we are interested in
         * @param {string} url URL where extract the value of the param
         * @returns {string|null}
         */
        function extractUrlValue(key, url) {
            if (typeof(url) === "undefined"){
                url = window.location.href;
            }
            var match = url.match("[#?&]" + key + "=([^&#]+)");
            return match ? match[1] : null;
        }

        /**
         * Function to create a cookie
         * @param {string} name Name of the cookie
         * @param {string} value Value of the cookie
         * @param {number} days Cookie expiration
         */
        function createCookie(name, value, days) {
            if (days) {
                var date = new Date();
                date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
                var expires = "; expires=" + date.toGMTString();
            } else var expires = "";
            document.cookie = name + "=" + value + expires + "; path=/";
        }
    </script>
</head>
<body>
</body>
</html>

  • Include this code on the last page of the application process (where the data is sent to Talent.com).
JavaScript sending page
<!DOCTYPE html>
<html>
<head>
</head>
<body onload="sendPostbackToTalent()">

    <script>
        // ----------------- Write this code on the last page of the process -----------------
        // STEP 2: Get the clickid value from the cookie and send it to Talent.com with the tracker and the apply_step
        /**
         * Function to send the clickid, the tracker, and the apply_step to Talent.com
         */
        function sendPostbackToTalent() {
            // Get the clickid from the cookie and store it in a variable
            var clickid = getCookie("clickidValue");

            // Store the tracker in a variable from the URL provided by your point of contact in Talent.com
            // https://www.talent.com/tracker/postback.php?tracker=XXXXXX
            var tracker = "XXXXXX";

            // Define the apply_step, or initiate it to an empty value
            // Example: var apply_step = "thankfulPage";
            // In this example, we are going to initiate it as an empty value
            var apply_step = "";

            // Create a paragraph element to wrapped all the process
            var paragraphWrapper = document.createElement("p");

            // Create an image element to trigger the action
            var talentImage = document.createElement("IMG");

            // The postbackURL will be the URL provided by your talent account representative. Ensure that contains
            // the GET parameters "tracker" with your company name/alias, the clickid and the apply_step (optional).
            var postbackURL = "https://www.talent.com/tracker/postback.php?tracker=" + tracker + "&clickid=" + clickid + "&apply_step=" + apply_step;

            // Set the target link
            talentImage.setAttribute("src", postbackURL);

            // Append the image element to the paragraph element
            paragraphWrapper.appendChild(talentImage);

            // Append the paragraph element either to the body element of your page or another element
            document.body.appendChild(paragraphWrapper);
        }

        /**
         * Function to get the value stored in a cookie
         * @param {string} name Name of the cookie
         * @returns {string|null}
         */
         function getCookie(name) {
            var cookie = document.cookie
            .split(";")
            .filter((temp) => temp.search(RegExp(name)) > -1);
            return cookie.length > 0
                ? cookie[0].split("=").pop().trim()
                : null;
         }
    </script>
</body>
</html>

Backend Request

In this option, you can make a GET request using cURL (read more about cURL here: cURL’s documentation).

The following code snippet is meant to serve as an example of how to implement a talent postback tracker via a backend request. Considering the intricacies of your code base, the snippet might have unintended consequences. Code must be vetted by a knowledgeable developer before being introduced into your code base.

See an example below:

Example in PHP:

Backend request in PHP
<?php
# -------------------- Process to send Postback to Talent.com --------------------

# Write in this variable the tracker provided by Talent.com. Example:
# https://www.talent.com/tracker/postback.php?tracker=XXXXXX
$tracker = "XXXXXX";

# Save the clickid we provide during the job redirect. Example:
# https://yourcompany.com/track/?clickid=306b6v79845
$clickid = $_GET["clickid"];

# You can save the place where the clickid is sent to us, to track the user experience
# (the apply_step value could be different or even "", depending on where is your track applied)
# Example: $apply_step = "thankfulPage";
# In this example, we are going to initiate it as an empty value
$apply_step = "";

# URL for the request
$url = "https://www.talent.com/tracker/postback.php";
$dataArray = ["tracker" => $tracker, "clickid" => $clickid, "apply_step" => $apply_step];
$data = http_build_query($dataArray);
$getUrl = $url . "?" . $data;

# Init a cURL channel
$ch = curl_init();

# cURL Set options
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $getUrl);
curl_setopt($ch, CURLOPT_TIMEOUT, 80);

# Execute the request
$response = curl_exec($ch);

# Manage the results
if (curl_error($ch)) {
    echo "Request Error: " . curl_error($ch);
} else {
    echo $response;
}

# Close the cURL channel
curl_close($ch);