AdGyde Logo

User Flow


1. Overview
'User Flow' allows the Application Developer to gauge the movement of its users through the activities defined in the application. By analyzing the user flow Sankey diagram, the App developer can predict how many users moved from one activity to another and how many people dropped from which activity.

Suppose for a Contesting Application the user flow is expected to be as below:
  1. Splash Screen
  2. Home
  3. Contest List Screen
  4. Winner Gallery
Below user flow explains such behavior where users move from one activity to another and number of impressions.



User can even know the number of inflow and outflow of the users with respect to one node. For example, in below image 'Home' node tells the flow from root, SplashScreen and LoginScreen where All in left represent inflow to HomeScreen and All on right represent outflow from HomeScreen.





2. Integration

Normal User Flow: In AdGyde Android SDK, User Flow is linked to the android application Life Cycle and so is calculated automatically without any requirement for integration.

Custom User Flow: In case application contains WebView’s and application needs to track user flow for the WebView views then this functionality can be used. Because WebView is a single activity and Android by default tracks activity flow.

To add a screen in User Flow, execute the setCurrentScreen function
AdGyde.setCurrentScreen(Context context, String ScreenName);

To remove a screen from User Flow, execute the removeCurrentScreen function
AdGyde.removeCurrentScreen(Context context, String ScreenName);

Below is the sample code for the Custom Flow which can be used with WebView pages

public class MainActivity extends AppCompatActivity
{
WebView simpleWebView;
Button loadWebPage;
String url ="https://www.adgyde.com";

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// initiate buttons and a web view
loadWebPage = (Button) findViewById(R.id.loadWebPage);
simpleWebView = (WebView) findViewById(R.id.simpleWebView);

loadWebPage.setOnClickListener(new View.OnClickListener()
{
@SuppressLint("SetJavaScriptEnabled")

@Override
public void onClick(View v)
{
simpleWebView.setWebViewClient(new MyWebViewClient());

simpleWebView.getSettings().setJavaScriptEnabled(true);
simpleWebView.loadUrl(url);
}
});
}

private class MyWebViewClient extends WebViewClient
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
String pageURL = view.getUrl();
String pageName="";
Log.d("xxxx", "page url----" + pageURL);
int countSls=pageURL.lastIndexOf("/")+1;
int countDot=pageURL.lastIndexOf(".");
if((countDot-countSls)>0)
{
pageName= pageURL.substring(pageURL.lastIndexOf("/") + 1, pageURL.lastIndexOf("."));
Log.d("xxxx", "page url----" + pageName);
AdGyde.setCurrentScreen(context, pageName);
}
else
{
pageName=pageURL.substring(pageURL.lastIndexOf("/") + 1, pageURL.length());
AdGyde.setCurrentScreen(context, pageName);
Log.d("xxxx", "page url----" + pageName);
}
return true;
}
}

public void onDestroy()
{
super.onDestroy();
}
}


This website uses cookies in order to improve your experience and our services. By continuing to use our website, agree to the use of such cookies. Click here for Privacy Policy.