def __init__(self, options):
        super(GoogleAnalytics, self).__init__(options)

        # Required parameters for each payload
        property_id = options.get("property_id", "UA-XXXX-Y")
        client_id = options.get("client_id", '555')

        self.google_analytics = GoogleAnalyticsInterface(
            property_id=property_id, client_id=client_id)
Exemple #2
0
from iot_analytics.interfaces import GoogleAnalyticsInterface
from iot_analytics.models import Event
'''
This is an example for how to use the python iot_analytics
package to record data to a self hosted database.
'''

# Create a new interface
interface = GoogleAnalyticsInterface()

# Create an event object
event = Event("ROBOT1-ID", {
    'category': 'button',
    'action': 'pressed',
    'label': 'momentary',
    'value': 10
})

# Add the event via the interface
interface.add(event)
Exemple #3
0
 def setUp(self):
     self.interface = GoogleAnalyticsInterface(property_id='UA-12573345-12',
                                               client_id='testing')