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 which activity is most popular among its users and where the drop-off rates are high.

Suppose for a Food Delivery Application the user flow is expected to be as below:
  1. User selects Restaurant
  2. User selects Cuisine
  3. Add to basket
  4. Payment Completed
Below user flow explains such behavior where users move from one activity to another.



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, category and promotion where blue represents 'inflow' and red represents 'outflow'.





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 postback 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.