Free Tool to Get Users to Vote for your Greenlight Game in the Steam Client

One of the biggest problems with promoting a Greenlight campaign is that users are usually not logged into Steam in their web browser. This means that even after you’ve done everything right to entice users to click on your Greenlight URL, they can’t vote for your game unless they first log into Steam in their browser, which also means approving their browser through Steam Guard! You probably know how this goes: the end result is that those precious hard earned clicks fail to convert into votes because the user has too many barriers and hurdles in front of them to quickly cast their vote.

BLG Greenlight Tool (PHP Scripts)

License: CC0       Platform: PHP

This little PHP tool is a way to help mitigate that problem, by opening your Greenlight page both in the user’s browser, and also in the user’s Steam client itself. However, the Steam mobile client doesn’t work the same way as it’s desktop counterpart, so this script also detects whether or not the user is on a mobile device, and if so, it doesn’t bother to try and load the Steam client.

Origins of this Tool

These scripts were inspired by this old reddit thread as well as the comment left by pdyxs. Since there is no code to copy and paste in that thread, once I got done spending 30 minutes tinkering with my own implementation of the concepts, I decided to share my code with you. As a gamedev, we’re all busy, or maybe you’re not even a programmer, but just handling marketing. Regardless, I present to you an indie game marketing solution that you can use “as-is” (just replace the URL with your Greenlight URL) or that you can use to integrate into your code.

Documentation

The Basic Concept

If you didn’t click on the reddit thread, the real quick summary is that your typical Greenlight URL looks like this:

http://steamcommunity.com/sharedfiles/filedetails/?id=530536300

which when clicked will only open your Greenlight page in the user’s browser. Like I said in the intro, this means if they are not logged into Steam in their browser they will have to log in and probably check their email or cellphone to pass Steam Guard, which is an unrealistic level of burden to expect anyone to do for your Greenlight game. So the solution is use this type of URL to open the game using the Steam client instead:

steam://url/CommunityFilePage/530536300

While you can certainly use HTML tags to link like this: <a href=”steam://url/CommunityFilePage/530536300″>VOTE HERE</a> the problem is that when you post on Facebook, Twitter, forums or anywhere else that you cannot directly enter URLs, those sites will not recognize it as a valid link. This is where my scripts can help you.

Using the BLG Greenlight Tool

So you downloaded the tool, but how do you use it? First, you need a web host that allows you to run PHP scripts… meaning virtually any web host. If you don’t have a web host yet, go get one right now. A website is a fantastic tool for any game developer, so you should already have one if you’re running a Greenlight campaign</lecture>

Before we can use the download, we need to unzip the file blg-greenlight-tool.zip. Most people unzip on their computer and then upload the files to their server, usually through FTP. For ZIP files, I prefer 7-zip, and for FTP I use FileZilla. Both are free and open source. If you don’t know how to ZIP or FTP then Google it or talk with your web host about uploading scripts. For the sake of this documentation, I’m going to assume you uploaded the entire folder.

Don’t upload the files yet though! First let’s open up config-greenlight.php and change these two values:

$my_games_name = ‘YOUR GAME\’S NAME’;
$steam_greenlight_id = ‘530536300’;

Where it says YOUR GAME\’S NAME replace it with your game’s actual name. Where it says 530536300 replace that with the ID to your Steam Greenlight campaign. You can find the ID at the end of your Steam Greenlight URL, so for example: http://steamcommunity.com/sharedfiles/filedetails/?id=530536300

After editing my values now look like this:

$my_games_name = ‘My Game\’s Actual Name’;
$steam_greenlight_id = ‘530536300’;

Now save the file, and upload the folder or all 3 files. Once they’re uploaded, visit your URL, like this:
http://yourwebsite.com/the/path/to/where/you/uploaded/this/greenlight-home.php

Be sure to replace yourwebsite.com/the/path/to/where/you/uploaded/this/ with where you actually uploaded the files. If you filled in the details correctly, when you visit that URL, you should be redirected in the browser to your Greenlight page, but you should also be prompted to open the link in Steam at the same time!

What is included?

There are 3 files in the blg-greenlight-tool.zip file, they are contained in a folder named blg-greenlight-tool:

  • config-greenlight.php – The file you edit to put your Greenlight details.
  • greenlight-home.php – The file you point your links to, that displays your Greenlight page and opens the Steam Client on desktops only.
  • redirect-to-greenlight.php – This file is a header redirect that tells the browser to open your Greenlight page in the Steam Client. If you point links to this file, it will redirect to steam://url/CommunityFilePage/YourID

DEMO In Action!

Want to see how this works with a live example? Check out my game on Greenlight then! I use bit.ly to shorten the URL and for basic analytics.
vote_on_greenlight

Download the BLG Greenlight Tool

BLG Greenlight Tool (PHP Scripts)

License: CC0       Platform: PHP

Source Code

When you download these PHP scripts, you have full access to the source code which is licensed as CC0/public domain.  However, for the sake of completeness I’ll be walking through each file in this section. Version 1.0.1 removes the closing PHP tags to avoid unintended headers already sent errors.

config-greenlight.php – This is the file you edit to put your Greenlight details in. Below the 2 variables you need to edit, the code tries to determine if the user is on a mobile device, and finally it sets the URLs for the regular link and the Steam link.  This file is included in the top of the two other scripts.  Here is the code:

<?php
/** 
 * BLG Greenlight Tool
 *
 * Free Tool to Get Users to Vote for your Greenlight Game in the Steam Client
 *
 * @link https://blacklodgegames.com/free-tool-greenlight-game-steam-votes/ 
 * @version 1.0.1
 * @author BLACK LODGE GAMES, LLC
 * @copyright 2016 BLACK LODGE GAMES, LLC
 * @license CC0 https://creativecommons.org/publicdomain/zero/1.0/ 
 * @package blg-greenlight-tool
 */

$my_games_name = 'YOUR GAME\'S NAME';	// Replace this with your game's name
$steam_greenlight_id = '530536300';		// Replace this with the ID of your Greenlight.  Your ID is that end of your Greenlight URL:
                    // http://steamcommunity.com/sharedfiles/filedetails/?id=530536300

// Do not modify below this line: ----------------------------------------
if( stristr($_SERVER['HTTP_USER_AGENT'],'ipad') || stristr($_SERVER['HTTP_USER_AGENT'],'iphone') || strstr($_SERVER['HTTP_USER_AGENT'],'iphone') || stristr($_SERVER['HTTP_USER_AGENT'],'blackberry') || stristr($_SERVER['HTTP_USER_AGENT'],'android') ) {
  
  $isMobile = true;
} else {
  
  $isMobile = false;
}										

$steamGreenlightURL = 'http://steamcommunity.com/sharedfiles/filedetails/?id='.$steam_greenlight_id;	
$steamClientGreenlightURL = 'steam://url/CommunityFilePage/'.$steam_greenlight_id;

redirect-to-greenlight.php – This file is a header redirect that tells the browser to open your Greenlight page in the Steam Client. If you point links to this file, it will redirect to steam://url/CommunityFilePage/YourID

<?php
/** 
 * BLG Greenlight Tool
 *
 * Free Tool to Get Users to Vote for your Greenlight Game in the Steam Client
 *
 * @link https://blacklodgegames.com/free-tool-greenlight-game-steam-votes/ 
 * @version 1.0.1
 * @author BLACK LODGE GAMES, LLC
 * @copyright 2016 BLACK LODGE GAMES, LLC
 * @license CC0 https://creativecommons.org/publicdomain/zero/1.0/ 
 * @package blg-greenlight-tool
 */

include_once('config-greenlight.php');

header('Location: '.$steamClientGreenlightURL);

greenlight-home.php – The file you point your links to, that displays your Greenlight page and opens the Steam Client on desktops only.  It does this by using two iframes… I know what you’re thinking, iframes are evil!  Normally I’d agree, but this is the exception to the rule as this is percisely the fringe case where they’re still the best tool for the job.  One iframe is big, and extends the entire document (which is what that inline CSS does.)  This is the iframe that displays your Greenlight page in the browser.  The other iframe is 1px in size, and it points to our other file redirect-to-greenlight.php, which opens the Steam Client.  You’ll notice in the code that if we detected a mobile device, the 2nd iframe is never rendered.  We also have a fallback if the desktop browser doesn’t render iframes.

<?php
/** 
 * BLG Greenlight Tool
 *
 * Free Tool to Get Users to Vote for your Greenlight Game in the Steam Client
 *
 * @link https://blacklodgegames.com/free-tool-greenlight-game-steam-votes/ 
 * @version 1.0.1
 * @author BLACK LODGE GAMES, LLC
 * @copyright 2016 BLACK LODGE GAMES, LLC
 * @license CC0 https://creativecommons.org/publicdomain/zero/1.0/ 
 * @package blg-greenlight-tool
 */

include_once('config-greenlight.php');

?><html>
<head>

<title><?PHP echo $my_games_name; ?> Steam Greenlight</title>

</head>
<body style="background-color:#000;color:#FFF;margin: 0;">
<iframe src="<?PHP echo $steamGreenlightURL; ?>" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; z-index:999999;">
<center>Your browser doesn't support iframes.
Click <a href="<?PHP echo $steamGreenlightURL; ?>">here</a> to go to the <?PHP echo $my_games_name; ?> Steam Greenlight page.</center>
</iframe>
<?PHP if ($isMobile == false) { ?>
<iframe width="1" height="1" src="./redirect-to-greenlight.php" scrolling="no" frameborder="0"></iframe>
<?PHP } ?>
</body>
</html>

Need Help?

Did this work for you? Do you have a question, comment, or concern? Let me know in the comments below! Thanks for reading!

Do you like this content? If so, please share the love:

Comments

  1. Hariharan S

    i need help from you

    1. No problem, how can I assist?

Leave a Reply

Your email address will not be published. Required fields are marked *