def validate(self): ''' According to the GA documentation, there is a limit to the combined size of name and value of 64 bytes after URL encoding, see http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#varTypes and http://xahlee.org/js/google_analytics_tracker_2010-07-01_expanded.js line 563 This limit was increased to 128 bytes BEFORE encoding with the 2012-01 release of ga.js however, see http://code.google.com/apis/analytics/community/gajs_changelog.html ''' if len('%s%s' % (self.name, self.value)) > 128: raise exceptions.ValidationError('Custom Variable combined name and value length must not be larger than 128 bytes.')
def validate(self): if not self.source: raise exceptions.ValidationError( 'Campaigns need to have at least the "source" attribute defined.' )
def validate(self): if len(self.items) == 0: raise exceptions.ValidationError( 'Transaction need to consist of at least one item')
def validate(self): if not (self.action and self.network): raise exceptions.ValidationError( 'Social interactions need to have at least the "network" and "action" attributes defined.' )
def validate(self): if not self.sku: raise exceptions.ValidationError( 'sku/product is a required parameter')
def validate(self): if not (self.category and self.action): raise exceptions.ValidationError( 'Events, at least need to have a category and action defined.')