- Joined
- May 2, 2018
- Messages
- 3,745
A few months ago I published a guide called How to Start With Galaksion Ad Network. Before that Iâve published a few case studies like these:
This script will pull data from your traffic source (in this case Galaksion) and optimise based on that data. Optimising while using data from traffic source will take click loss into consideration. This might actually be a good idea, as long as you are comfortable with posting back conversions to your traffic source.
You can download/copy the script here

Clicking on the image above (or this link) will create a copy of the Optimizer script in your Google account and youâll be the only person that will have access to that version of the script.
For this script to work, youâll need to make sure postbacks are correctly set up from your tracker to the traffic source. You can find the instructions on how to set up a postback to Galaksion here. One thing Iâve noticed with postback on Galaksion is that they donât have a token for offer payout in postback URL, so optimising based on ROI will not be available this time.
This script will not load data from your tracker, but youâll still need to use the tracker to postback conversions back to the traffic source.
If you are sure your postback is correctly set up, you can now go on and create a new campaign on Galaksion. Once your campaign is created, open the Campaigns page, and look for the ID of your campaign, like this:
Remember that ID - youâll need that ID to put it in the Configuration tab.
As I mentioned before - this script doesnât pull the data from the tracker, so the last thing youâll need to enter in the Configuration tab is your Galaksion username and password. Those 2 fields are used to generate the API key used in API calls. Itâs kinda weird that you have to use your username and password to generate the API key every time, but it is how it is.
NOTE: The API section is available in the Galaksion account by request.
Once you add your Username, Password and Campaign ID you are ready to add some optimization rules to the Rules sheet!
Here are simple instructions on how to add a rule:
1. Block all zones that have spent more than $5 in the last 7 days and have cost per conversion (CPA) higher than $0.5 (for example, if your offer payout is $0.5, this is a 10x spend rule)
2. Block all zones that have spent more than $2 in the last 24 hours and have 0 conversions (< 1).
3. Pause campaign which spent more than $50 in the last 7 days and has cost per conversion higher than $0.9.
4. Pause campaign which spent more than $10 in the last 7 days and had 0 conversions (<1).
1. Nothing selected in 2nd drop-down field (comparison field, must be set to greater or lower)
2. Action not selected (Do what field empty)
3. Rule turned OFF (checkbox not checked)
4. No time frame selected (Data from field empty)
1. Block all zones which spent more than $2 in the last 7 days and have conversion rate lower than 0%.
Whatâs wrong with this? You expect the CV to be negative. If the zone didnât get any conversions, that CV on that zone will be 0%, not lower than 0%.
2. Block zones which spent more than $2 in the last 7 days and have the number of conversions lower than 0.
Whatâs wrong with this? You expect the number of conversions to be negative. If the zone didnât get any conversions, that number of conversions on that zone will be 0%, not lower than 0%. If you want to fetch all zones that have 0 conversions, use Conversions / lower / 1.
3. Block zones that have spent more than $3 in the last 7 days.
Whatâs wrong with this? Well it will block ALL zones that spend more than $3 - even the ones that have conversions. Usually, youâll want to add more conditions under the same rule, for example under the 2nd condition you could add CPA / greater / 0.3.
If you want this script to run every 15 minutes, every day, follow these steps:
Select Extensions > Apps Script from the main menu. Then select Triggers from the left menu.
Then, click on the + Add Trigger button:
And configure the settings in popup like this:
Once you are done - click on Save.
TIP: I suggest you donât use values lower than âEvery 15 minutesâ in the last drop down because executing Google Sheets Apps Scripts can be slow and your script might run for 5-6 minutes on each run. You donât want the same script running twice at the same time. So setting the script to run every 15 minutes should be OK.
When you click Save, you might need to give some permissions to this script, so popups like these might show up:
Pick the Google account you wish to use with this script.
Click on the Advanced button.
And then click on the bottom link.
Click on the Allow button. And now you should see a trigger in the list, like this:
You are all set! The script will run every 15 minutes, every day.
While you can use CPA bidding to start with, it might happen that your campaign will start getting less and less traffic in case there are other campaigns in the Galaksion network that perform better than yours.
You should be able to collect some data with the initial CPA test and find some profitable zones. If your CPA campaigns die too quickly, you might consider creating blacklist CPM campaigns with those zones. That way you should be able to get constant traffic at a fixed CPM cost. And if your campaign starts getting traffic from new zones (that are not already blacklisted) this script would take care of them. Also, if some of the existing profitable zones take a dip when it comes to CPA cost, this script can also exclude them from the campaign.
So I think blacklist CPM campaigns should be a good fit for this script. Iâm not sure it makes sense to use this script for CPA campaigns. If you are looking for instructions on how to relaunch campaigns on Galaksion, you can read this post. In that post CPA bidding is used, but you can do the same for CPM campaigns.
This script works with all available add formats on Galaksion; popunder and push.
Let me know in the comments below if you are using this script and if there is anything I can do to improve it!
- Galaksion Audience Targeting Test (New vs Regular vs Old)
- Will higher CPM give me a higher conversion rate?
- How Frequency Capping Has Affected My Conversion Rate and CPA?
This script will pull data from your traffic source (in this case Galaksion) and optimise based on that data. Optimising while using data from traffic source will take click loss into consideration. This might actually be a good idea, as long as you are comfortable with posting back conversions to your traffic source.
You can download/copy the script here

Clicking on the image above (or this link) will create a copy of the Optimizer script in your Google account and youâll be the only person that will have access to that version of the script.
For this script to work, youâll need to make sure postbacks are correctly set up from your tracker to the traffic source. You can find the instructions on how to set up a postback to Galaksion here. One thing Iâve noticed with postback on Galaksion is that they donât have a token for offer payout in postback URL, so optimising based on ROI will not be available this time.
This script will not load data from your tracker, but youâll still need to use the tracker to postback conversions back to the traffic source.
If you are sure your postback is correctly set up, you can now go on and create a new campaign on Galaksion. Once your campaign is created, open the Campaigns page, and look for the ID of your campaign, like this:
Remember that ID - youâll need that ID to put it in the Configuration tab.
As I mentioned before - this script doesnât pull the data from the tracker, so the last thing youâll need to enter in the Configuration tab is your Galaksion username and password. Those 2 fields are used to generate the API key used in API calls. Itâs kinda weird that you have to use your username and password to generate the API key every time, but it is how it is.
NOTE: The API section is available in the Galaksion account by request.
Once you add your Username, Password and Campaign ID you are ready to add some optimization rules to the Rules sheet!
Adding Rulesâ
This script supports adding up to 3 rules for each campaign. Each rule can have a maximum of 3 conditions.Here are simple instructions on how to add a rule:
- You need to turn the rule ON first. Click on the checkbox (1) near the Rule name, and then a box should switch from red to green.
- Next, youâll need to select at least one condition. You donât have to use all three, but youâll have to enter at least one. Your rule can optimize by 4 different fields:
- Conversions
- CV
- Cost
- CPA
- Impressions
- Clicks (only available for push campaigns)
- CTR (only available for push campaigns)
- CPC (only available for push campaigns)
- Then youâll need to pick how you want this rule to compare values. You can select between higher or lower.
- And the last field (4) is the value. In case you want to use decimal values, youâll need to use the dot and not comma. So for example if you want to create a rule that will block all zones that spent more than $11.50 and have no conversions, youâll put 11.50 (and not 11,50) in the field. Also, donât put $ signs in those fields. Just numbers.
- Now you need to define the action of the rule. If the above conditions are met, what should the script do? You can choose between Block zone and Pause campaign options.
- Last field you need to fill out is the time range (6 - Data from). If your campaign is getting a lot of traffic you may want to optimize based on a shorter time range, and in case your campaign is not getting much traffic, select a wider time range. The script can load the data from:
- last 24 hours
- last 3 days
- last 7 days
- last 14 days
- last 30 days
- Once you run the script (or Google Sheets runs in, based on settings Iâll explain later), the Last run field should show some values (date and time). If itâs empty, it means your rule hasnât run yet.
- If you want to run the script now (manually) you can always click on the RUN SCRIPT NOW button. Loading the data and running the optimization rules in the background can take a while (if you have a lot of data - sometimes it can take up to 5 minutes) so donât press this too much. If the script is running, you can check the Log sheet and wait once the script is done.
Here are a few examples of valid rules:â
1. Block all zones that have spent more than $5 in the last 7 days and have cost per conversion (CPA) higher than $0.5 (for example, if your offer payout is $0.5, this is a 10x spend rule)2. Block all zones that have spent more than $2 in the last 24 hours and have 0 conversions (< 1).
3. Pause campaign which spent more than $50 in the last 7 days and has cost per conversion higher than $0.9.
4. Pause campaign which spent more than $10 in the last 7 days and had 0 conversions (<1).
And here are a few examples of invalid rules:â
1. Nothing selected in 2nd drop-down field (comparison field, must be set to greater or lower)2. Action not selected (Do what field empty)
3. Rule turned OFF (checkbox not checked)
4. No time frame selected (Data from field empty)
Of course, you can create a valid rule which doesnât make much sense. Iâll post a few examples:â
1. Block all zones which spent more than $2 in the last 7 days and have conversion rate lower than 0%. Whatâs wrong with this? You expect the CV to be negative. If the zone didnât get any conversions, that CV on that zone will be 0%, not lower than 0%.
2. Block zones which spent more than $2 in the last 7 days and have the number of conversions lower than 0.
Whatâs wrong with this? You expect the number of conversions to be negative. If the zone didnât get any conversions, that number of conversions on that zone will be 0%, not lower than 0%. If you want to fetch all zones that have 0 conversions, use Conversions / lower / 1.
3. Block zones that have spent more than $3 in the last 7 days.
Whatâs wrong with this? Well it will block ALL zones that spend more than $3 - even the ones that have conversions. Usually, youâll want to add more conditions under the same rule, for example under the 2nd condition you could add CPA / greater / 0.3.
Running the script 24/7â
Make sure you have at least one valid rule set before creating a trigger that will run the script every 15 minutes.If you want this script to run every 15 minutes, every day, follow these steps:
Select Extensions > Apps Script from the main menu. Then select Triggers from the left menu.
Then, click on the + Add Trigger button:
And configure the settings in popup like this:
Once you are done - click on Save.

When you click Save, you might need to give some permissions to this script, so popups like these might show up:
Pick the Google account you wish to use with this script.
Click on the Advanced button.
And then click on the bottom link.
Click on the Allow button. And now you should see a trigger in the list, like this:
You are all set! The script will run every 15 minutes, every day.
When to use the Optimizer script?â
Galaksion supports CPA bidding, so Iâd suggest you always start your campaigns on CPA model. That way, youâll get the best traffic right from the start, and the CPA algorithm will optimise your campaign while itâs alive (ie. it will stop sending traffic from zones that arenât converting or convert but with high CPA).While you can use CPA bidding to start with, it might happen that your campaign will start getting less and less traffic in case there are other campaigns in the Galaksion network that perform better than yours.
You should be able to collect some data with the initial CPA test and find some profitable zones. If your CPA campaigns die too quickly, you might consider creating blacklist CPM campaigns with those zones. That way you should be able to get constant traffic at a fixed CPM cost. And if your campaign starts getting traffic from new zones (that are not already blacklisted) this script would take care of them. Also, if some of the existing profitable zones take a dip when it comes to CPA cost, this script can also exclude them from the campaign.
So I think blacklist CPM campaigns should be a good fit for this script. Iâm not sure it makes sense to use this script for CPA campaigns. If you are looking for instructions on how to relaunch campaigns on Galaksion, you can read this post. In that post CPA bidding is used, but you can do the same for CPM campaigns.
This script works with all available add formats on Galaksion; popunder and push.
Let me know in the comments below if you are using this script and if there is anything I can do to improve it!
