media_source,
campaign, ad_name etc.generateOneLinkURL. The
method generates the infrastructure to fire an impression in the
next step.af_xplatform parameter to afCustom in
the afParameters object in order to enable
cross-platform attribution:
var afParameters =
{
...
afCustom: [
{ paramKey: "af_xplatform", keys: [], defaultValue: "true" },
],
};
generateOneLinkURL was
successful and call the method fireImpressionsLink to fire the
impression.
var OL_result = window.AF_SMART_SCRIPT.generateOneLinkURL({
oneLinkURL,
afParameters: afParameters,
});
// Verify that the returned result from generateOneLinkURL() is not null.
// If verified, fire the impression.
if (OL_result) {
// The following command will fire the impression.
// The impression will fire to https://impressions.onelink.me//....
// The wait is a temporary bug fix
setTimeout(() => {
window.AF_SMART_SCRIPT.fireImpressionsLink();
console.log("Impression fired");
}, 1000);
}
generateDirectClickURL. If generation is
successful, the created link will be placed as the link behind the
button. generateDirectClickURL accepts the following
arguments:
afParameters: these are the same attribution
parameters we've collected to send with the impression in the
previous section. The af_xplatform is removed since
it is no longer required.
platform: The platform this link aims for, e.g.
steam, epic, playstation etc.
app_id: The application ID in this platformredirectURL: The URL the user will be redirected in
order to install the game, e.g. the link in the steam store