Slide 14
Slide 14 text
GTM & GA
// Initializing
TagManager tagManager = TagManager.getInstance(context);
PendingResult pending =
tagManager.loadContainerPreferNonDefault(CONTAINER_ID,
R.raw.gtm_default_container);
pending.setResultCallback(new ResultCallback() {
@Override
public void onResult(ContainerHolder containerHolder) {
ContainerHolderSingleton.setContainerHolder(containerHolder);
if (!containerHolder.getStatus().isSuccess()) {
Log.e(TAG, "failure loading container");
return;
}
startMainActivity();
}
}, 2, TimeUnit.SECONDS);
// Getting A/B value
Container c = ContainerHolderSingleton.getContainerHolder().getContainer();
String pattern = c.getString(“pattern”);