-
Notifications
You must be signed in to change notification settings - Fork 0
Screens 212e31
Once your tag is initialised, you can start tagging your screens.
If you want to use variables, be sure to import ATInternet, Tracker and Screen classes in your Activity or Fragment.
Declare a Tracker-type variable in your Activity
package com.atinternet.atinternetdemo;
import android.app.Activity;
import android.os.Bundle;
import com.atinternet.tracker.ATInternet;
import com.atinternet.tracker.Tracker;
public class MainActivity extends Activity {
private Tracker tracker;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tracker = ATInternet.getInstance().getDefaultTracker();
}
@Override
protected void onResume() {
super.onResume();
}
}To tag a screen, the tracker exposes a screens object.
Two solutions are available to tag a screen:
- Define one or several tagging and send the hit(s) at the desired moment
- Send screen tagging directly
To do this, the screens object of the Tracker class offers an add method.
This method enables the addition of screen tagging which can be sent at the desired moment (e.g. onCreate, onResume…).
The add method sends back a Screen-type object. To send the defined information, you must manually call the sendView method of your Screen object, or call the Tracker�s dispatch method.
The method can take several different parameters:
- A character string to give a specific name
- A Context to retrieve the class name where tagging is done
- Tagging a screen:
@Override
protected void onResume() {
super.onResume();
tracker.Screens().add("Home").sendView();
}- Screen tagging with context:
@Override
protected void onResume() {
super.onResume();
tracker.Screens().add(this).sendView();
}- Tagging a screen with a level 2:
@Override
protected void onResume() {
super.onResume();
tracker.Screens().add("Home").setLevel2(1).sendView();
}- Tagging a screen with chapters:
@Override
protected void onResume() {
super.onResume();
tracker.Screens().add("Today News", "Home", "News").sendView();
}- Screen tagging with addition of a custom object: In this example, the name of the screen is not entered because it is possible to put the name in the stc parameter in order to use it with DataManager.
@Override
protected void onResume() {
super.onResume();
Screen s = tracker.Screens().add(this);
s.CustomObjects().add(new HashMap<String, Object>() {{
put("page", "Home");
}});
s.sendView();
}- Tagging a screen with use of dispatcher:
@Override
protected void onResume() {
super.onResume();
tracker.Screens().add("Home");
tracker.dispatch();
}| Name | Type | Default value | Description |
|---|---|---|---|
| name | String | Empty string | Gets or sets the screen name |
| chapter1 | String | null | Gets or sets the first chapter |
| chapter2 | String | null | Gets or sets the second chapter |
| chapter3 | String | null | Gets or sets the third chapter |
| action | Enum | Action.View | Gets or sets the action type |
| level2 | Int | -1 | Gets or sets the level 2 ID |
| isBasketScreen | Bool | false | Indicates that the screen displays the content of a cart (in the case where the SalesTracker option is used) |
| Publishers | PublisherImpressions | null | Class enabling the tagging of your ads impressions |
| SelfPromotions | SelfPromotionImpressions | null | Class enabling the tagging of your self-promotion impressions |
| CustomObjects | CustomObjects | null | Class enabling the addition of custom objects on your hits |
| CustomVars | CustomVars | null | Class enabling the addition of custom variables on your screen hits |
| Name | Return type | Description |
|---|---|---|
| --- | --- | --- |
| sendView | void | Sends the screen hit |
| Aisle(int level1) | Aisle | Adds an aisle |
| Campaign(String campaignId) | Campaign | Adds a campaign |
| setCart(Cart cart) | void | Set a cart to the screen |
| Order(String orderId, double turnover) | Order | Adds an order |
| Location(double latitude, double longitude) | Location | Adds location informations |
| InternalSearch(String keywordLabel, int resultPageNumber) | InternalSearch | Adds internal search informations |
| CustomTreeStructure(int category1) | CustomTreeStructure | Adds a custom tree |
Last update: 13/03/2018
-
Data API
- Data flow
- Advice optimizations data flow
- Error codes data flow
- Faq data flow
- General information data flow
- Technical information data flow
- Reporting API v3
- Getting started
- Methods
- Parameters
- Technical information
- REST API
- Campaigns
- Custom variables
- Getting started rest
- Methods rest
- Response structure parameters rest
- Fixed periods
- Parameters compatibility
- Relative periods
- Structure of the response
- “code” parameter
- “columns” parameter
- “evo” parameter
- “filter” parameter
- “include” parameter
- “lng” parameter
- “max-results” parameter
- “page-num” parameter
- “period” parameter
- “period” parameter: “H” v. “He” & “MN” v. “MNe”
- “retention” parameter
- “segmentdesc” parameter
- “segment” parameter
- “sep” parameter
- “sort” parameter
- “space” parameter
- Technical specifications rest
- Data flow
-
Data collection
- Android
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- Apple
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- General
- Cddc renew staging process
- Changelog
- Craft your hit
- Encoded parameters
- Server side cookie management
- Supported taggings
- Tagging deletion
- Utilisation of dispatch sdks
- JavaScript
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Partners javascript
- Users
- Piano Analytics
- Event tagging piano analytics
- Getting started piano analytics
- Piano analytics tagging
- Feeding piano analytics with as2 tagging
- Tagging custom properties sdk
- Android