Game Landing Page Demo

Smart Script V2

The source code for this page can be found here.


Click on one of the store buttons below in order to fire AppsFlyer click event

Apple Appstore link Google Play store link Steam store link Epic store link Oculus quest store link Nintendo Switch store link psn store link Xbox Microsoft store link Native PC store link

Flow diagram

Web-to-Desktop flow

Implementation guidelines

Fire an impression

The impression is created using the Smart Script.
In order to create an impression the Smart Script requires a OneLink template, with cross-platform attribution enabled.
Firing an impression includes the following steps:

  1. Initializing the Smart Script arguments. These arguments will carry the impression data, e.g. media_source, campaign, ad_name etc.
    The argument values are retrieved from the incoming URL query parameters (e.g. UTM parameters) or default values.
    Information regarding more Smart Script arguments can be found here.
  2. Call the Smart Script method generateOneLinkURL. The method generates the infrastructure to fire an impression in the next step.
    Information regarding this method can be found here.
    Note: It is mandatory to add the 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" }, 
      ], 
    };
  3. Fire an impression - verify the method 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);
    }
                    
                  

Create installation links

In this section we will create platform-specific installation links, the link will route the user to the relevant store (e.g. Steam store).
For each redirection button in the page we will run the Smart-Script method generateDirectClickURL. If generation is successful, the created link will be placed as the link behind the button.
The method 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 platform
  • redirectURL: The URL the user will be redirected in order to install the game, e.g. the link in the steam store

Platform specific links created on this page: