Return to Video

More About Downloading Containers

  • 0:00 - 0:01
    So far,
  • 0:01 - 0:06
    we've used the loadContainerPreferFresh
    method to load the container.
  • 0:06 - 0:08
    And this takes the containerID,
  • 0:08 - 0:12
    which you get from the TagManager UI,
    and the defaultContainer.
  • 0:13 - 0:16
    So this method checks if
    the app has a container
  • 0:16 - 0:20
    that's been refreshed in
    the past 12 hours or so.
  • 0:20 - 0:23
    And if it does,
    then we load the container.
  • 0:23 - 0:27
    And if there isn't a fresh container,
    then load a new one over the network.
  • 0:27 - 0:32
    And if there's a timeout or
    a network error before the container
  • 0:32 - 0:38
    finishes loading, then the container
    holder status is set to unsuccessful.
  • 0:38 - 0:41
    There are a couple of other methods for
    loading the container,
  • 0:41 - 0:45
    loadContainerDefaultOnly, which will
    only get the default container,
  • 0:45 - 0:49
    and then there's also
    loadContainerPreferNonDefault.
  • 0:50 - 0:53
    So this one prefers to not
    use the default container but
  • 0:53 - 0:56
    doesn't necessarily look for
    a fresh container.
  • 0:56 - 1:01
    To get the freshest value,
    use loadContainerPreferFresh.
  • 1:01 - 1:03
    But fresh is a relative term.
  • 1:03 - 1:08
    If we look at the reference page for
    TagManager, it says that the mobile app
  • 1:08 - 1:11
    refreshes a container from
    the network every 12 hours.
  • 1:12 - 1:15
    So one of the benefits of
    TagManager is that non-developers
  • 1:15 - 1:17
    cannot put changes to an app.
  • 1:17 - 1:21
    And these will often be bulk
    uploads of many values.
  • 1:21 - 1:25
    This mechanism is not really meant for
    second-by-second changes, but
  • 1:25 - 1:27
    it's nice to see the changes
    when we're developing our app.
  • 1:27 - 1:31
    And that's why we added the call
    to manually refresh the container.
  • 1:31 - 1:35
    Here's the reference,
    the refresh method on the container.
  • 1:35 - 1:39
    And it says, in order to limit
    the frequency of network communication,
  • 1:39 - 1:43
    refresh method is throttled, and
    that you're supposed to wait at least 15
  • 1:43 - 1:46
    minutes before calling
    this method again.
  • 1:46 - 1:49
    So even manual refreshes are not
    guaranteed to take effect
  • 1:49 - 1:50
    more than about every 15 minutes.
  • 1:52 - 1:55
    I've had good luck with my changes
    taking effect very quickly
  • 1:55 - 1:59
    when I change variable values in
    TagManager, but it's not guaranteed.
  • 1:59 - 2:02
    If you don't see the changes
    taking effect immediately,
  • 2:02 - 2:03
    don't be too surprised.
Title:
More About Downloading Containers
Description:

04-13 More about Downloading Containers

more » « less
Video Language:
English
Team:
Udacity
Project:
UD876-2 - Google Play Services - Analytics
Duration:
02:04

English subtitles

Revisions Compare revisions