v0.8.2: added analytics campaign tracking to ShatteredPixel.com links

This commit is contained in:
Evan Debenham 2020-07-21 23:20:52 -04:00
parent cc8f85b7b3
commit 2895c212f7
2 changed files with 13 additions and 2 deletions

View File

@ -57,12 +57,18 @@ public class AboutScene extends PixelScene {
//*** Shattered Pixel Dungeon Credits *** //*** Shattered Pixel Dungeon Credits ***
String shpxLink = "https://ShatteredPixel.com";
//tracking codes, so that the website knows where this pageview came from
shpxLink += "/?utm_source=shatteredpd";
shpxLink += "&utm_medium=android";
shpxLink += "&utm_campaign=about_page";
CreditsBlock shpx = new CreditsBlock(true, Window.SHPX_COLOR, CreditsBlock shpx = new CreditsBlock(true, Window.SHPX_COLOR,
"Shattered Pixel Dungeon", "Shattered Pixel Dungeon",
Icons.SHPX.get(), Icons.SHPX.get(),
"Developed by: _Evan Debenham_\nBased on Pixel Dungeon's open source", "Developed by: _Evan Debenham_\nBased on Pixel Dungeon's open source",
"ShatteredPixel.com", "ShatteredPixel.com",
"https://ShatteredPixel.com"); shpxLink);
shpx.setRect((w - fullWidth)/2f, 6, 120, 0); shpx.setRect((w - fullWidth)/2f, 6, 120, 0);
content.add(shpx); content.add(shpx);

View File

@ -299,7 +299,12 @@ public class NewsScene extends PixelScene {
@Override @Override
protected void onClick() { protected void onClick() {
super.onClick(); super.onClick();
DeviceCompat.openURI(article.URL); String link = article.URL;
//tracking codes, so that the website knows where this pageview came from
link += "/?utm_source=shatteredpd";
link += "&utm_medium=android";
link += "&utm_campaign=news_page";
DeviceCompat.openURI(link);
} }
}; };
link.setRect(0, height + 2, width, BTN_HEIGHT); link.setRect(0, height + 2, width, BTN_HEIGHT);