Module Expr Str ImportFrom alias ImportFrom alias alias ClassDef bases NameLoad body Assign NameStore Str Assign NameStore ListLoad TupleLoad Str Str TupleLoad Str Str FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMod Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Str Assign NameStore Str Assign NameStore ListLoad Str Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If NameLoad body Assign NameStore IfExp Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str BinOpMod NameLoad TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareIs NameLoad NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index Str Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If BoolOpAnd NameLoad CompareIn Str NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list Assign NameStore Call NameLoad Str Assign NameStore Str
N/A N/A This module integrates Google OAuth2_ services and APIs with lux.

When the ``google`` dictionary is included into the :setting:`OAUTH_PROVIDERS`
dictionary, the :ref:`google angular module <js-lux-google>` is added to the
:ref:`javascript context object <js-lux-context>` which can be used by
AngularJS if the :mod:`lux.extensions.angular` module is included in
the list of :setting:`EXTENSIONS` of your application.

Google analytics
====================
To use google analytics add the ``analytics`` dictionary to the
``google`` dictionary in :setting:`OAUTH_PROVIDERS`::

    OAUTH_PROVIDERS = {
        ...,
        'google': {
            ...,
            'analytics': {
                'id': 'UA-54439804-2',
                ...
            }
        }
    }

When using google analytics integration with :mod:`lux.extensions.angular`
in `ui.router`_ mode (:setting:`ANGULAR_UI_ROUTER` set to ``True``) one
must be aware that **pageview** events are not triggered anymore.

To handle this situation the :ref:`google angular module <js-lux-google>`
interacts with google analytics to register pageviews and custom events
by listening for the `$stateChangeSuccess` event.

Google maps
===============
To use google map, a ``simple_key`` entry in ``google`` config dictionary must
be specified. The simple key is used by google to identify your project when
you do not need to access user data::

    OAUTH_PROVIDERS = {
        ...,
        'google': {
            'simple_key': '...'
            'map_sensor': True,
            ...
        }
    }

.. _OAuth2: https://developers.google.com/accounts/docs/OAuth2
.. _`ui.router`: http://angular-ui.github.io/ui-router/site
 string Template oauth OAuth2 OAuth2Api Api N/A OAuth2Api N/A N/A url https://www.googleapis.com/adexchangebuyer/v1.3 N/A headers N/A N/A content-type application/json N/A x-li-format json user N/A N/A self N/A N/A N/A url N/A %s/~ N/A self url N/A response N/A N/A N/A self http get url headers N/A self headers N/A N/A N/A response raise_for_status N/A N/A N/A response json N/A N/A Google N/A OAuth2 N/A N/A auth_uri https://accounts.google.com/o/oauth2/auth N/A token_uri https://accounts.google.com/o/oauth2/token N/A default_scope N/A profile email N/A fa google on_html_document N/A N/A self request doc N/A N/A N/A N/A N/A self google_context doc N/A N/A N/A self add_analytics doc N/A key N/A N/A N/A self config get simple_key N/A key N/A N/A sensor N/A N/A N/A N/A self config get map_sensor true false N/A N/A N/A doc jscontext N/A googlemaps N/A google_map_url N/A key sensor N/A google_context N/A N/A self doc N/A N/A N/A google N/A N/A N/A doc jscontext get google N/A N/A google None N/A N/A N/A N/A doc jscontext N/A google N/A N/A add_analytics N/A N/A self doc N/A N/A N/A google N/A N/A doc jscontext N/A google N/A analytics N/A N/A N/A self config get analytics N/A N/A analytics N/A id analytics N/A N/A N/A google N/A analytics analytics N/A N/A ga analytics N/A N/A N/A analytics N/A ga ga N/A txt N/A N/A GOOGLE_ANALYTICS substitute analytics N/A N/A N/A N/A doc head append txt N/A N/A N/A GOOGLE_ANALYTICS N/A Template <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','$ga');

  $ga('create', '$id', 'auto');
  $ga('send', 'pageview');

</script> N/A google_map_url async!https://maps.googleapis.com/maps/api/js?key=%s&sensor=%s