YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← More About Downloading Containers

Get Embed Code
4 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. So far,
  2. we've used the loadContainerPreferFresh
    method to load the container.
  3. And this takes the containerID,
  4. which you get from the TagManager UI,
    and the defaultContainer.
  5. So this method checks if
    the app has a container
  6. that's been refreshed in
    the past 12 hours or so.
  7. And if it does,
    then we load the container.
  8. And if there isn't a fresh container,
    then load a new one over the network.
  9. And if there's a timeout or
    a network error before the container
  10. finishes loading, then the container
    holder status is set to unsuccessful.
  11. There are a couple of other methods for
    loading the container,
  12. loadContainerDefaultOnly, which will
    only get the default container,
  13. and then there's also
    loadContainerPreferNonDefault.
  14. So this one prefers to not
    use the default container but
  15. doesn't necessarily look for
    a fresh container.
  16. To get the freshest value,
    use loadContainerPreferFresh.
  17. But fresh is a relative term.
  18. If we look at the reference page for
    TagManager, it says that the mobile app
  19. refreshes a container from
    the network every 12 hours.
  20. So one of the benefits of
    TagManager is that non-developers
  21. cannot put changes to an app.
  22. And these will often be bulk
    uploads of many values.
  23. This mechanism is not really meant for
    second-by-second changes, but
  24. it's nice to see the changes
    when we're developing our app.
  25. And that's why we added the call
    to manually refresh the container.
  26. Here's the reference,
    the refresh method on the container.
  27. And it says, in order to limit
    the frequency of network communication,
  28. refresh method is throttled, and
    that you're supposed to wait at least 15
  29. minutes before calling
    this method again.
  30. So even manual refreshes are not
    guaranteed to take effect
  31. more than about every 15 minutes.
  32. I've had good luck with my changes
    taking effect very quickly
  33. when I change variable values in
    TagManager, but it's not guaranteed.
  34. If you don't see the changes
    taking effect immediately,
  35. don't be too surprised.