How Parameters & Macros Work

Offer URLs, affiliate tracking links, and other URLs in HasOffers carry valuable information between you, your advertisers, and your publishers. 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 HasOffers 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 affiliate 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 affiliate 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 affiliate IDs vary with each affiliate 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 HasOffers, 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 affiliate 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 affiliate ID values from our database.

That means that if the generated transaction ID is "ABCDEF-120021" and the affiliate 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 HasOffers 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 HasOffers 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 HasOffers
Conversion Link HasOffers 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 HasOffers, you append the HasOffers 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 Publishers

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

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

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

Link Type Whose Parameters Whose Values/Macros
Affiliate Conversion Link Publisher HasOffers
Affiliate Tracking Link HasOffers Publisher

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 publisher. In HasOffers, you do this while generating the affiliate tracking link.

To store information about the traffic source, you append the HasOffers 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 publisher 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 publisher, 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 publisher's traffic source.

Learn More

This is just an introduction to working with parameters and macros in HasOffers. 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 HasOffers parameters you can use to request information, read our articles on:

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

No Comments

Leave a reply