Skip to content

Attribution via landingpage

Use case

Besides the ability to track standard links, Steam Data Suite also allows you to track visitors to your websites. This is a great tool if you use a website or landing page to promote your game as a visit to your page can be an attribution source.

Implementation

Our Javascript library enables you to send any call you may need to the SDS endpoints. It also has helper functions to make it easy to populate the necessary data object.

Download and self-host the library. It has no dependencies. Include it in the html of the desired page, preferably near the end.

				
					<script src="path-to-file/SteamDataSuite_web.js"></script>
				
			

Configuration

Structure

First the library is initiated using the create() command, after which events can be sent.

There are three events you can trigger, representing different ways of applying tracking.

  1. A Send event sends a click-like signal to Steam Data Suite to register any non-click event for later attribution.
  2. An Update event allows you to update all links on a page with the appropriate Steam Data Suite campaign parameters.
  3. An Hotlink event allows to apply smart hotlinking to any link from the page to Steam.

Parameters used in sending events can be fixed numerical values, based on the values on the Dynamic Links page, string values, or parsed parameters from the current url, if necessary converting it along the way.

create( gamekey, debug )

Run the initialization code with create() anywhere after including the library. The game-specific key needed for this can be found on the Dynamic Links page.

Initializes the library. Only after this is done Triggers and Helper functions can be used.
Parameter Description Type of value Required
Game key Game specific identifier retrieved from Dynamic Links. 1b5c2b980b5942b08faf7ff0fbba0000 Yes
Debug mode enabled ‘true’ to see console.log() debug feedback for the module. False by default. ‘true’/’false’ No
				
					sds.create('1b5c2b980b0942b08faf7ffffbba0000')
				
			

The game-specific key will be used for all requests, and allows us to understand for which game the request is intended.

send( { type:type, channel:channel, name:name, variant:variant, } )

Sends a non-click campaign event to Steam Data Suite servers

KeyDescriptionMandatoryValue
typeCampaign typeYesInteger from the list of allowed values
channelCampaign channelYesInteger from the list of allowed values
nameDescriptive name of campaignYesA string matching the requirements
variantDescription of variant within the campaign, usually used to describe creative, audience, etc.NoA string matching the requirements
				
					<script>
    sds.send({
        type:       1,
        channel:    2,
        name:       sds.string( 'Event landing page' ),
        variant:    sds.string( 'Buy now button footer'),
    })
</script>
				
			

update( { type:type, channel:channel, name:name, variant:variant, } )

When triggered finds all Steam Data Suite links on the page, and replaces the destination of that link to include the fed campaign parameters. Links are processed if they are elements with a href starting with https://steam.gs/.

KeyDescriptionMandatoryValue
typeCampaign typeYesInteger from the list of allowed values
channelCampaign channelYesInteger from the list of allowed values
nameDescriptive name of campaignYesA string matching the requirements
variantDescription of variant within the campaign, usually used to describe creative, audience, etc.NoA string matching the requirements
				
					<script>
    sds.update({
        type:       1,
        channel:    2,
        name:       sds.string( 'Event landing page' ),
        variant:    sds.string( 'Buy now button footer'),
    })
</script>
				
			

When triggered finds all links matching the queryselector then applies smart hotlinking to it. Smart hotlinking tries, on a click, to open the Steam storepage in the Steam app relevant for the device, with fallback to the web version of Steam. It also takes care of the ‘click’ registration asynchronously.

Key Description Mandatory
queryselector A JS queryselector reference to the links you want to hotlink Yes
steamid The Steam ID as used in the Steam storepage url for the game Yes
				
					<a class="hotlinkme" href="http://steam.gs/l/Vl95w">Go to game</a>
<script>
    sds.hotlink(
        '.hotlinkme',
        304950
    )
</script>
				
			

Helper functions

fromurl( name, default, conversion table )

Reads a URL parameter value from the current page URL, for use as one of the campaign values for any of the triggers.

ParameterDescriptionType of valueRequired
NameURL key name to use the value of.StringYes
DefaultValue to default to in case the key is missing from the URL.String(url safe) or integer, depending on the value needed.No
Conversion tableIn case a URL value needs to be converted, for example from channel name (string) to the appropriate channel id (integer), a conversion can be facilitated.Object with pairs to look for and replace. Values not in the object get passed as is.No
				
					<script>
    sds.send({
        type:       1,
        channel:    sds.fromurl( 'utm_medium', 13, {'facebook':2, 'google':1, 'reddit':4} )
        name:       sds.fromurl( 'utm_channel', 'organic' ),
        variant:    sds.fromurl( 'utm_content' ),
    })
</script>
				
			

string( value )

Helper function that can be used to URL-encode any text value. Should be used for all manually provided thus non-encoded string. String() does not need to be used for a parameter where you are already using sds.fromurl() as it’s safe to say the values we collect from the URL are already URL-encoded.

ParameterDescriptionType of valueRequired
valueThe value to make url-safeStringYes
				
					<script>
    sds.send({
        type:       1,
        channel:    5,
        name:       sds.string( 'Maybe/søme,funky...characters!' ),
        variant:    sds.string( 'Or just a string with spaces'),
    })
</script>
				
			

Testing

If everything is configured properly you should see your own activity in the Campaign overview page. Some remarks;

  • All activity is mentioned in the Campaign overview in the column ‘clicks’, although this may as well be a non-click (pageview) event.
  • The column ‘clicks’ counts unique events, so during testing from the same/similar systems only one event will be counted.

Examples

Example Initialization

				
					<script>
    sds.create('1b5c2b980b5942b08faf7ff9fbba0000')
</script>
				
			

Example Send event

				
					<script>
    sds.send({
        type:       1, // Represents 'Sales/Installs'
        channel:    5, // Represents 'Ads other'
        name:       sds.fromurl( 'utm_campaign', 'unknown' ), // Gets the value for utm_campaign from url, uses 'unknown' as fallback
        variant:    sds.fromurl( 'utm_medium', 'organic' ), // Gets the value for utm_medium from url, uses 'organic' as fallback
    })
</script>
				
			

This sends a click-like signal to register any non-explicit click for later attribution. You can trigger this either when your website visitor performs a specific action, or on loading the page.

It is not uncommon to configure fixed numerical values for type and channel, only using the name and variant field for campaign specific string values. By doing this

Example Update event

				
					<a href="https://steam.gs/aRc74/">Buy now!<a>
<script>
    sds.update({
        type:       1, // Represents 'Sales/Installs'
        channel:    5, // Represents 'Ads other'
        name:       sds.fromurl( 'utm_campaign', 'unknown' ), // Gets the value for utm_campaign from url, uses 'unknown' as fallback
        variant:    sds.fromurl( 'utm_medium', 'organic' ), // Gets the value for utm_medium from url, uses 'organic' as fallback
    })
</script>
				
			

Calling this finds all Steam Data Suite links on the page and replaces the URL to a version with the correct tracking parameters. More info

Page contents