Track Taboola Conversions Using S2S Postbacks

Server to Server (S2S) conversion tracking allows you to track multiple conversions, without installing the Taboola Pixel. These conversions can be, for example, mobile app installs and post-install events - such as signups and purchases - that happen after a user clicks on your Taboola campaign creatives.

Conversion tracking helps you gather important insights about actions users are taking on your app or website, and gives you the ability to measure the impact, return on your ad spend, and to optimize your campaigns accordingly.

What Can I Track Using S2S Conversion Tracking?

Using S2S conversion tracking, you can track any type of user interaction in your app or website that you would like to optimize in Taboola’s Backstage. You can also represent your multi-conversion funnel using S2S tracking. For example:

Downloads - You can track downloads of your app from places like the App Store (iOS) or Google Play (Android).
In-app Events - You can track many post-install events, such as when a user reaches a certain level in an app or makes a post-install purchase.

Add S2S Tracking to your Taboola Campaign.

After a user clicks on your content, Taboola will notify your server’s with a click value.

You will need to add the Taboola {click_id} macro into your Taboola campaign tracking code. This will populate with a value that is sent to your site or to your 3rd party platform.

When a conversion is made by the relevant user, the {click_id} value is included in a postback URL which sends the conversion information to Taboola to be reflected in Backstage reporting.

In Backstage:

  1. Go to the Campaign Management page.
  2. Then click +New Campaign or edit an existing campaign.
  3. In the Campaign page, go to the Tracking section at the bottom of the page.
  4. Add a parameter to your Tracking Code that is set to equal “{click_id}” as conversion cannot be recorded without it. The parameter you use should allow you to record this value and later populate it in your postback URL to attribute the conversion. This can also be added as a parameter at the item level. You can learn more about how to add URL parameters here.

It is vital to NOT alter the {click_id} macro, otherwise your Conversions will not be tracked.

Create S2S Conversions

Note: To check if you are already sending events to Backstage, and to save time, you can use the Active tab as a shortcut. Learn more here.

  1. To define conversions with S2S tracking, go to the Taboola Pixel menu, and select Conversions. Here you can view existing conversions or set up and define new conversions that came from either the Taboola Pixel or S2S tracking. Note that you do not need to implement the pixel to track conversions with S2S.
  2. Click New Conversion to set up and start tracking a new conversion.
  3. Select the conversion Type as Event.
  4. Select either Popular or Custom, and then fill in all of the relevant fields. See Tracking and Reporting Conversions for additional information. Make note of the value in your Event Name field as this is will be used in the next step.

Important Note: The code you see here is NOT relevant for S2S and should be ignored. Please use the postback URL in the next step.

Instead of the event code from the Conversion, use a postback URL for tracking conversions. Postback URLs sit in your server’s backend and will fire only for events related to Taboola. Create a new postback URL for each conversion created in Backstage. The highlighted values below should be changed to the respective values below.
https://trc.taboola.com/actions-handler/log/3/s2s-action?click-id=CLICK_ID&name=EVENT_NAME

  • CLICK_ID– Replace with a macro that will populate with the Click ID generated on the Taboola user’s click. Taboola macros should NOT be used as this macro will be specific to your internal technology. This macro should populate with the same value created by the {click_id} macro implemented in your campaign’s tracking code to tie the conversion to this initial click.

  • EVENT_NAME - Replace with the corresponding Event Name value in Backstage

Pixel or S2S Postback for Tracking Conversion

Whoever operates in the performance advertising industry knows that tracking and optimization are crucial to become successful. There are no workarounds here.

Conversion Tracking Pixel

Tracking Pixel, also known as browser-based or cookie-based, is a tracking method which enables to track webpage visits, ad impressions, conversions and other types of online user activities.

Pros:

  • When you own the “thank you page” (meaning that you don’t buy media on behalf of any 3rd party) and you don’t have the technical resources necessary to implement postback tracking, a conversion tracking pixel is for you.

  • It is simple and quick to implement a solution, effortless to use, so you don’t need to be an expert and you can start tracking right away.

  • It is a matter of just copying and pasting the code into the code of the final thank you page that a user sees after the conversion happened.

    Cons:

  • Occasionally, pixels might not fire. Why? One of the reasons could be that the user cleared their cache between clicking on a link on a landing page and the actual conversion. In such case, a conversion will not be tracked and there is nothing that can be done about it.

  • Apple implemented Intelligent Tracking Protection 2.0 on Safari which prevents websites from being able to track users’ browsing habits without their permission. Right now, a website can request tracking privileges, but the user has to specifically opt-in. Even if the user opts in for tracking in Safari, if she or he doesn’t interact with that particular website over the period of 30 days, data and cookies will be immediately deleted. All in all, pixel tracking is more difficult on Safari.

S2S Postback Tracking

Postback URL Tracking, also known as server-side tracking or Server-to-Server (S2S) uses an offer provider’s servers to track sessions generated on clicks to attribute conversions.

Pros:

  • S2S postback URLs are the most secure and reliable method to count conversions, thus it is highly recommended to use this form of automated tracking whenever you can. Ad Tracker S2S postback URLs are unique to each account and are supplied in both a secure (HTTPS) and nonsecure (HTTP) format.
  • S2S postback URLs allow for accurate tracking and stats gathering. This type of tracking happens on the back-end of systems so it cannot be tampered by users. For this reason, it is being considered as one of the most trusted methods for tracking.

    Cons:

  • Postback tracking may seem more complex to implement and requiring a more tech-savvy approach. But is it really? With S2S in Ad Tracker, you need to know how macros work, under which parameter you should pass the value of the ClickId, and which token to use within an affiliate network’s postback URL when it’s sent back to Ad Tracker. But no worries, we have step-by-step instructions for you, here and here. If you spend a couple of minutes to understand the pattern, you will become a postback pro.

Conclusion

Use pixel tracking as little as possible, as pixel tracking only works for non-mobile web traffic where cookies can be stored. Additionally, major browsers like Safari, Chrome, and Firefox are moving away from allowing tracking-related cookies even for first parties.

Postback Tracking is independent of the user’s browser. Postback tracking can be thought of as two separate processes: what happens when a user clicks on an offer and what happens upon conversion.

Vue: How to display unescaped(raw) html

Starting with Vue2, the triple braces were deprecated, you are to use v-html.

1
<div v-html="task.html_content"> </div>

It is unclear from the documentation link as to what we are supposed to place inside v-html, your variables goes inside v-html.

Also, v-html works only with <div> or <span> but not with <template>.

Another example

1
2
<p>Using mustaches: {{ rawHtml }}</p>
<p>Using v-html directive: <span v-html="rawHtml"></span></p>

Dynamically rendering arbitrary HTML on your website can be very dangerous because it can easily lead to XSS vulnerabilities. Only use HTML interpolation on trusted content and never on user-provided content.

Javascript - Regular Expression Tips

Escaping

As we’ve seen, a backslash “" is used to denote character classes. So it’s a special character.

There are other special characters as well, that have special meaning in a regexp. They are used to do more powerful searches.

Here’s a full list of them: [ \ ^ $ . | ? * + ( ).

se the \ character to escape a character that has special meaning inside a regular expression.

To automate it, you could use this:

1
2
3
function escapeRegExp(text) {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}

RegExp

The RegExp constructor creates a regular expression object for matching text with a pattern.

Syntax

1
2
3
/pattern/flags
new RegExp(pattern[, flags])
RegExp(pattern[, flags])

for the flags

  • g: global match; find all matches rather than stopping after the first match
  • i: ignore case; if u flag is also enabled, use Unicode case folding
  • m: multiline; treat beginning and end characters (^ and $) as working over multiple lines (i.e., match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole input string)
  • u: Unicode; treat pattern as a sequence of Unicode code points
  • y: sticky; matches only from the index indicated by the lastIndex property of this regular expression in the target string (and does not attempt to match from any later indexes).

How to use Propel Media pixel

What are Dynamic Tracking Variables and why are they important to me?

Using HTML pixels or S2S postbacks are a common way to track events performed by users after they see an ad. These conversion records are important because they provide performance insights into the ad beyond just knowing if the user clicked on the ad.

Often times, there are values that are unique to a particular industry or business and these values need to be tracked with each conversion. Some examples include:

  • eCommerce businesses needing to track SKU code(s)
  • Affiliate Networks needing to track conversion ID(s) from other tracking platforms
  • Online services needing to track UserID(s)

With Dynamic Tracking Variables, you can track up to three separate values with each conversion that is stored. These values can then be reviewed in a Conversion Detail export as needed.

How To Configure Dynamic Tracking Variables

HTML Pixel:

  1. Generate an HTML conversion pixel per the instructions outlined.

  2. Within your tracking pixel, find the section that looks like this:

    1
    src="https://tracking.propelmedia.com/?id=1G5B426FG9415G93CEFD34123511&fetch=1&value=0"
  3. At the end of the URL address, add the parameters you wish to track with. Remember, the options are ‘c1’, ‘c2’ and ‘c3’. You will add one or multiple of these options by appending an “&” symbol, the parameter itself, and then an ‘=’ symbol. For example:

    1
    src="https://tracking.propelmedia.com/?id=1G5B426FG9415G93CEFD34123511&fetch=1&value=0&c1=&c2=&c3="
  4. Configure the values that will be passed into Propel Media with each conversion. This step may need to be done by a developer who is familiar with your site or app. If you are firing this pixel from a third party tracking platform, you may be able to use macros from that platform to dynamically append the appropriate information.

    Here is an example where we are appending orderID and SKU codes from an eCommerce site using Shopify:

    1
    2
    3
    4
    src="https://tracking.propelmedia.com/?id=1G5B426FG9415G93CEFD34123511&fetch=1&value=0&c1={{ order\_number }}&c2=
    {% for line\_item in line\_items %}
    {{ forloop.index }}={{ line\_item.sku }}^
    {% endfor %}"

    S2S Postback:

  5. Generate a S2S postback URL per the instructions outlined.

  6. At the end of the URL address, add the parameters you wish to track with. Remember, the options are ‘c1’, ‘c2’ and ‘c3’. You will add one or multiple of these options by appending an “&” symbol, the parameter itself, and then an ‘=’ symbol. For example:

    1
    https://tracking.propelmedia.com/?id=1G5FDWERTB6FG941AG65746736&value=0&token={token}
  7. Configure the values that will be passed into Propel Media with each conversion. This step may need to be done by a developer who is familiar with your site or app. If you are firing this pixel from a third party tracking platform, you may be able to use macros from that platform to dynamically append the appropriate information.

    Here is an example where we are appending orderID from a tracking platform that uses the macro {orderID} to dynamically return the value:

    1
    https://tracking.propelmedia.com/?id=1G5FDWERTB6FG941AG65746736&value=0&token={token}&c1={orderID}

Conversion Detail Report

Once we have all of our pixels/postbacks updated and placed on the proper site(s), we will need a way to query our conversions and utilize the information being tracked. Due to the level of detail and amount of data involved in Conversion level reports, they can only be accessed via export.

To export your Conversion Report:

  1. Navigate to your Tracking Manager by going to Settings in the main navigation menu and then selecting Tracking Pixels.
  2. Select “Export Conversions” from just above the top right corner of the grid.
  3. Select the Conversion Event you wish to export information from the dropdown.

FAQ

  • What if I am passing multiple SKU values with the conversion?
    • This is not a problem. You can use symbols such as “^” to separate the values and pass them all into a single variable. For example, if you have two SKUs to track in the c1 variable, you can write them as: &c1=SKU1^SKU2
  • What is the maximum number of characters that can be passed into each of the variables?
    • 255 Characters
  • I have conversions logged but when I attempt to export, the system is telling me there is nothing to export! Why?
    • Only conversions with custom values tracked are available for export. If the conversion did not have a value recorded in c1, c2 or c3, then they will not be available for export.

VUE and Vuetify

Vuefity is Material Design Component Framework for Vue. Highlights:

  • Ready-Made Project Scaffolding: Vuetify comes ready to go with 8 pre-made vue-cli templates. From simple html to full-blown SSR you are ready to go in minutes.
  • Semantic Material Components: Be prepared for an armada of specialized components at your disposal. With over 80 in total, there is a solution for any application.
  • Vibrant Community: When you run into a roadblock, you need assistance right away. Vuetify offers chat support in our growing community on Discord.

Create a project using Vue and Vuetify

1
2
3
4
5
npm install @vue/cli -g
vue create my-app
cd my-app
vue add vuetify
npm run serve

Notes:

  1. the default web site will be http://localhost:8080
  2. Version: “vue”: “^2.5.17”, “vuetify”: “^1.3.0”

#1 Involve an Apple Style footer

  1. Open the ‘App.vue’
  2. Add these code bellow the <v-content> element and within v-app.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    <v-content>
    <HelloWorld/>
    </v-content>

    <v-card height="100px" flat>
    <v-bottom-nav
    color="indigo"
    :value="true"
    fixed
    >
    <v-btn dark>
    <span>Video</span>
    <v-icon>ondemand_video</v-icon>
    </v-btn>

    <v-btn dark>
    <span>Music</span>
    <v-icon>music_note</v-icon>
    </v-btn>

    </v-bottom-nav>
    </v-card>
  3. open browser and test it.

Notes: for v-bottom-nav, use ‘fixed’ to make the footer always show at the bottom.

RabbitMQ 3.7.* Tips

RabbitMQ Management Plugin (Admin GUI)

The rabbitmq-management plugin provides an HTTP-based API for management and monitoring of RabbitMQ nodes and clusters, along with a browser-based UI and a command line tool.

It periodically collects and aggregates data about many aspects of the system. Those metrics are exposed to both operators in the UI and monitoring systems for long term storage, alerting, visualisation, chart analysis and so on.

The management plugin is included in the RabbitMQ distribution. Like any other plugin it must be enabled before it can be used. That’s done using rabbitmq-plugins: (Node restart is not required after plugin activation.)
Using ‘RabbitMQ Command Prompt (sbin dir)’ to run the following command:

1
rabbitmq-plugins enable rabbitmq_management

Write a node.js web crawler

How to write a node.js web crawler? And which node modules we will use? In this post, I’ll introduce how to write a web crawler using node.js

Node.js modules

cheerio

It is Fast, flexible & lean implementation of core jQuery designed specifically for the server. Using cheerio to work with html, and following links.

1
2
3
4
5
6
7
8
9
// cheerio
const cheerio = require('cheerio')
const $ = cheerio.load('<h2 class="title">Hello world</h2>')

$('h2.title').text('Hello there!')
$('h2').addClass('welcome')

$.html()
//=> <html><head></head><body><h2 class="title welcome">Hello there!</h2></body></html>

request

Request - Simplified HTTP client. Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.

1
2
3
4
5
6
const request = require('request');
request('https://www.google.com', function (error, response, body) {
console.log('error:', error); // Print the error if one occurred
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
console.log('body:', body); // Print the HTML for the Google homepage.
});

request-promise

The simplified HTTP request client ‘request’ with Promise support. Powered by Bluebird.
If you like the promise style, use this instead of the request directly.

1
2
3
4
5
6
7
8
var rp = require('request-promise');
rp('https://www.google.com')
.then(function (htmlString) {
// Process html...
})
.catch(function (err) {
// Crawling failed...
});

Full Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const rp = require('request-promise');
const cheerio = require('cheerio');
const options = {
uri: `https://www.google.com`,
transform: function (body) {
return cheerio.load(body);
}
};

rp(options)
.then(($) => {
console.log($);
})
.catch((err) => {
console.log(err);
});

Others

download image

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// using request
request(uri)
.pipe(fs.createWriteStream(fileName))

// demo using Q to download image and get a promise object.
function download(uri, fileName) {
return Q.nfcall(function (callback) {
request({
url: uri,
method: 'GET',
proxy: proxy
}, function (err, response, body) {
callback(err, body);
})
.pipe(fs.createWriteStream(fileName))
});
}

Top 10 Useful Service For Ubuntu Server.

Setup Basic Ubuntu Server

  • Make sure you select a LTS(Long Time Support) version of Ubuntu server
  • update installed services
    1
    apt-get update

Webmin

Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.

Install

Commands:

1
2
sudo apt-get update
sudo apt-get install webmin

For detail, following this guide to install webmin, http://www.webmin.com/deb.html.

Restart webmin

1
/etc/init.d/webmin restart

Shadowsocks

Install Shadowsocks Server

1
2
sudo apt update
sudo apt install shadowsocks-libev

configuration

By default it will auto start the service using this command

1
/usr/bin/ss-server -c /etc/shadowsocks-libev/config.json -u

The default of the config.json file is like this

1
2
3
4
5
6
7
8
{
"server":"127.0.0.1",
"server_port":8388,
"local_port":1080,
"password":"nacVulm2",
"timeout":60,
"method":"chacha20-ietf-poly1305"
}

You can change this configuration, and restart it.
e.g.

1
2
3
4
5
6
7
{
"server_port":443,
"password":"your_pwd_here",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}

Install client

Please google to get the iOS/Android/Windows client for shadowsocks clients.

Top 10 Useful git commands

Merge code from master or other branch to current branch

1
2
3
git checkout your-current-branch
git pull origin master
git push

Force to restore to a server branch

1
git reset --hard origin/master

Create Tag

1
2
git tag "your_tag_name"
git push origin --tags

Copy changed files to other folder

e.g. copy to ‘d:\temp'

1
git ls-files --modified | xargs -I {} cp --parents {} d:\temp\

Clean un-tracked files

  • To remove directories, run git clean -f -d or git clean -fd
  • To remove ignored files, run git clean -f -X or git clean -fX
  • To remove ignored and non-ignored files, run git clean -f -x or git clean -fx
  • Remove un-tracked/ignored folders and files, run git clean -fxd

Clean local git repository

to make the ‘.git’ folder a little smaller, you can clean the local git.

1
git gc --prune=now