How Parameters & Macros Work

Offer URLs, partner tracking links, and other URLs in TUNE carry valuable information between you, your advertisers, and your partners. Here, we introduce the tools you’ll use to send and receive that data: parameters, values, and macros.

Looking for tables? Skip to Learn More below for links to our parameter and macro reference pages.

Starting Point: Parameters & Values

In our Basics of Tracking with TUNE article, we introduced tracking links and conversion links as ways to send and receive information. But how does data get communicated through a link?

With each click and conversion, crucial information passes via a combination of parameters and values. A parameter tells a server what information is being passed (like the offer ID or a mobile device ID), and a value is the information itself. You can think of a parameter as a special word, and the value of that parameter is the definition of that word.

Let’s illustrate these concepts. Here’s a tracking link URL for a hypothetical offer with offer ID 1001 that was generated for partner ID 2002:

The offer_id parameter is paired with a value of “1001”, and the aff_id parameter is paired with a value of “2002”. Information sent as parameters and values have a certain structure to them—the parameter, then an equals sign (=), then the value.

Getting Technical: Query Strings

You may have noticed that the above URL also contains a question mark (?) just before the offer and partner IDs. When a server receives this kind of URL, the question mark indicates that anything that follows can be used in the server’s next task. The term query string refers to everything after the question mark in a URL.

Query strings are composed of parameter-value pairs, where each pair is separated by an ampersand (&). An ampersand indicates that another parameter is being added to the query string, and so precedes each parameter after the first.

Flexibility with Macros

Often, you don’t know the actual value you need to assign to a parameter. Things like transaction IDs vary with each click, and partner IDs vary with each partner using your tracking links. In those cases, you use macros in place of specific values.

A macro is a special value that will later be replaced with another piece of information. In TUNE, a macro is always enclosed by curly brackets ({}) and will be replaced with a value from our database.

As an example, you can use macros to fill in transaction ID and partner ID values for this hypothetical offer URL at the start of session tracking:

In this link, the trans parameter is paired with the macro “{transaction_id}”, and the aff parameter is paired with the macro “{affiliate_id}”. When our servers process the link, these two macros are replaced with the appropriate transaction ID and partner ID values from our database.

That means that if the generated transaction ID is “ABCDEF-120021” and the partner has an ID of “2002”, then the replacement looks like this:

From there, session tracking continues as if the values had been there all along.

When Do I Use Parameters & Macros?

Your use of parameters and macros changes based on who you’re working with. Your business contacts have their own tracking systems, and each system has its own set of parameters and macros. Because you need to consider multiple tracking systems while modifying a link, things can quickly become confusing.

We recommend thinking about who wants the data and who provides the data. The party requesting data inserts their parameters into the link, and the other party inserts their values or macros.

Working with Advertisers

When you work with an advertiser, they sometimes ask you for data associated with a click (like mobile device IDs). Those requests take the form of parameters in your offer URL, which you respond to using specific values or macros.

When your advertiser asks for information, the offer URL contains parameters from their tracking system. To give them the information, you can use TUNE macros or manually enter data in the offer URL.

When you ask for data from your advertiser, the situation is reversed. Your conversion link needs to be using TUNE parameters, and your advertiser can use macros from their tracking system or manually enter values in the conversion link.

Link Type Whose Parameters Whose Values/Macros
Offer URL Advertiser TUNE
Conversion Link TUNE Advertiser

Example: Getting Sale Amount Data

Let’s say you have an offer where you get paid a percentage of each sale. You want to keep track of sale amounts for each conversion on the offer, and you’re preparing to send a conversion link to your advertiser.

After you generate a conversion link in TUNE, you append the TUNE parameter for sale amount:

http://hasoffersdemo.go2cloud.org/aff_lsr?offer_id=1037&transaction_id=TRANSACTION_ID&amount=AMOUNT

Notice that the values for transaction ID and sale amount are written in all caps. This is so your advertiser can tell at a glance what needs to be replaced when they start working with the link.

From here, you give the link to your advertiser, who replaces the “TRANSACTION_ID” and “AMOUNT” placeholder values with the appropriate macros from their tracking system. Now whenever a user converts on the offer, you’re able to receive and store the sale amount from your advertiser in addition to the transaction ID.

Working with Partners

Just like when you work with advertisers, you may want to request data from your partners. These requests take the form of parameters in your partner tracking link and partner conversion link.

When your partner asks for information, the partner conversion link contains parameters from their tracking system. To give them the data, you can use TUNE macros or manually enter data in the partner conversion link.

When you ask for information from your partner, the situation is reversed and your partner tracking link needs to be using TUNE parameters. Your partner can then use macros from their tracking system or manually enter values in that tracking link.

Link Type Whose Parameters Whose Values/Macros
Partner Conversion Link Partner TUNE
Partner Tracking Link TUNE Partner

Example: Getting Traffic Source Data

Let’s say you’re setting up an offer, and you want to compare offer performance between traffic sources (like Twitter and other sites) of the same partner. In TUNE, you do this while generating the partner tracking link.

To store information about the traffic source, you append the TUNE source parameter:

http://offerdyne.go2cloud.org/aff_c?offer_id=1037&aff_id=2016&source=SOURCE

Notice that the traffic source value is written in all caps. This is so your partner can tell at a glance what needs to be replaced when they start working with the link.

From here, you give the link to your partner, who then replaces the “SOURCE” placeholder value with the appropriate macro from their tracking system. Now whenever session tracking begins through that tracking link, you’re able to receive and store the partner’s traffic source.

Learn More

This is just an introduction to working with parameters and macros in TUNE. Your knowledge of when and how to use certain types of parameters or macros can grow to accommodate your needs as you learn more about these topics.

For a summary of TUNE parameters you can use to request information, read our articles on:

For a summary of TUNE macros you can use to pass information, read our articles on:

No Comments

Leave a reply