Skip to content

Instantly share code, notes, and snippets.

@npruehs
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npruehs/b27519e1f94ddcb86384 to your computer and use it in GitHub Desktop.
Save npruehs/b27519e1f94ddcb86384 to your computer and use it in GitHub Desktop.
Game Analytics Windows 10 UWP Test Code
// Sandbox.
//this->ga = std::make_shared<GameAnalytics::GameAnalyticsInterface>(L"5c6bcb5402204249437fb5a7a80a4959", L"16813a12f718bc5c620f56944e1abc3ea13ccbac");
// Production.
this->ga = std::make_shared<GameAnalytics::GameAnalyticsInterface>(L"a6d2a92e3572aebadead9b477441a246", L"8a429b59cd53dfccd063205b501b869b99e7e6e9");
this->ga->Init().then([this](JsonObject^ response)
{
this->ga->SendUserEvent(GameAnalytics::User());
// == BUSINESS ==
this->ga->SendBusinessEvent(L"ItemType:ItemId", L"EUR", 100);
this->ga->SendBusinessEvent(L"ItemType:ItemId", L"EUR", 100, L"menu_shop");
// == RESOURCE ==
this->ga->SendResourceEvent(GameAnalytics::FlowType::FlowType::Source, L"Gold", L"Sword", L"Dagger", 400.0f);
// == PROGRESSION ==
this->ga->SendProgressionEvent(GameAnalytics::ProgressionStatus::ProgressionStatus::Start, L"Level2");
this->ga->SendDesignEvent(L"TestEventType:TestEvent1");
this->ga->SendProgressionEvent(GameAnalytics::ProgressionStatus::ProgressionStatus::Complete, L"Level2", 40);
this->ga->SendDesignEvent(L"TestEventType:TestEvent2");
this->ga->SendProgressionEvent(GameAnalytics::ProgressionStatus::ProgressionStatus::Start, L"Level3");
this->ga->SendDesignEvent(L"TestEventType:TestEvent3");
this->ga->SendProgressionEvent(GameAnalytics::ProgressionStatus::ProgressionStatus::Fail, L"Level3", 50);
this->ga->SendDesignEvent(L"TestEventType:TestEvent4");
// == DESIGN ==
this->ga->SendDesignEvent(L"TestEventType:TestEvent");
this->ga->SendDesignEvent(L"TestEventType:TestEvent", 12.0f);
// == ERROR ==
this->ga->SendErrorEvent(L"Exception:NullReference", GameAnalytics::Severity::Severity::Debug);
// == SESSION END ==
this->ga->SendSessionEndEvent();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment