Class: Zernio::TrackingTag
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::TrackingTag
- Defined in:
- lib/zernio-sdk/models/tracking_tag.rb
Overview
A platform measurement tag: the thing you create, install on a website, send events to, and target ads against. On Meta this is a Pixel (kind: pixel). The shape is platform-neutral so other platforms (Pinterest Tag, LinkedIn Insight Tag, etc.) can be added without changing the contract; platform-specific fields are absent where a platform has no equivalent. Returned by listTrackingTags, createTrackingTag, getTrackingTag, and updateTrackingTag.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#auto_tagging ⇒ Object
Google Ads: whether gclid auto-tagging is on for the ad account (needed to attribute conversions to clicks).
-
#automatic_matching_fields ⇒ Object
Customer data the tag matches automatically, where the platform reports it (Pinterest automatic enhanced match).
-
#code ⇒ Object
The base-code
<script>snippet to install on the site, including the page-view call. -
#creation_time ⇒ Object
Unix seconds the tag was created.
-
#events ⇒ Object
Platforms where each conversion is its own object: the tag's conversion events, with the id a site sends for each.
-
#id ⇒ Object
Platform-native tag id, the
{tagId}of the per-tag routes. -
#installed ⇒ Object
Convenience flag derived from
lastFiredTime: has the tag ever fired. -
#is_unavailable ⇒ Object
Whether the tag is in a broken/unavailable state (Meta
is_unavailable). -
#kind ⇒ Object
Platform-native flavor of the tag (Meta:
pixel). -
#last_fired_time ⇒ Object
Unix seconds of the last event the tag received, or
nullif it never fired. -
#name ⇒ Object
Returns the value of attribute name.
-
#owner_ad_account_id ⇒ Object
Ad account id (
act_...) that owns the tag, when reported. -
#owner_business_id ⇒ Object
Business Manager id that owns the tag, or
nullwhen the tag lives on a personal (non-BM) ad account. -
#platform ⇒ Object
Returns the value of attribute platform.
-
#site_tag_id ⇒ Object
The id the on-site code carries.
-
#status ⇒ Object
inactivewhen the platform reports the tag as broken/unavailable.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ TrackingTag
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ TrackingTag
Initializes the object
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 151 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::TrackingTag` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::TrackingTag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'site_tag_id') self.site_tag_id = attributes[:'site_tag_id'] end if attributes.key?(:'events') if (value = attributes[:'events']).is_a?(Array) self.events = value end end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'platform') self.platform = attributes[:'platform'] else self.platform = nil end if attributes.key?(:'kind') self.kind = attributes[:'kind'] else self.kind = nil end if attributes.key?(:'status') self.status = attributes[:'status'] else self.status = nil end if attributes.key?(:'code') self.code = attributes[:'code'] end if attributes.key?(:'last_fired_time') self.last_fired_time = attributes[:'last_fired_time'] end if attributes.key?(:'is_unavailable') self.is_unavailable = attributes[:'is_unavailable'] end if attributes.key?(:'installed') self.installed = attributes[:'installed'] end if attributes.key?(:'creation_time') self.creation_time = attributes[:'creation_time'] end if attributes.key?(:'automatic_matching_fields') if (value = attributes[:'automatic_matching_fields']).is_a?(Array) self.automatic_matching_fields = value end end if attributes.key?(:'owner_business_id') self.owner_business_id = attributes[:'owner_business_id'] end if attributes.key?(:'owner_ad_account_id') self.owner_ad_account_id = attributes[:'owner_ad_account_id'] end if attributes.key?(:'auto_tagging') self.auto_tagging = attributes[:'auto_tagging'] end end |
Instance Attribute Details
#auto_tagging ⇒ Object
Google Ads: whether gclid auto-tagging is on for the ad account (needed to attribute conversions to clicks).
63 64 65 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 63 def auto_tagging @auto_tagging end |
#automatic_matching_fields ⇒ Object
Customer data the tag matches automatically, where the platform reports it (Pinterest automatic enhanced match).
54 55 56 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 54 def automatic_matching_fields @automatic_matching_fields end |
#code ⇒ Object
The base-code <script> snippet to install on the site, including the page-view call. Populated by getTrackingTag, omitted from the list view.
39 40 41 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 39 def code @code end |
#creation_time ⇒ Object
Unix seconds the tag was created.
51 52 53 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 51 def creation_time @creation_time end |
#events ⇒ Object
Platforms where each conversion is its own object: the tag's conversion events, with the id a site sends for each.
26 27 28 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 26 def events @events end |
#id ⇒ Object
Platform-native tag id, the {tagId} of the per-tag routes. Meta: numeric pixel id, as a string. OpenAI: the pixel resource id. Google Ads: the 10-digit customer id (one Google tag per account).
20 21 22 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 20 def id @id end |
#installed ⇒ Object
Convenience flag derived from lastFiredTime: has the tag ever fired.
48 49 50 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 48 def installed @installed end |
#is_unavailable ⇒ Object
Whether the tag is in a broken/unavailable state (Meta is_unavailable).
45 46 47 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 45 def is_unavailable @is_unavailable end |
#kind ⇒ Object
Platform-native flavor of the tag (Meta: pixel).
33 34 35 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 33 def kind @kind end |
#last_fired_time ⇒ Object
Unix seconds of the last event the tag received, or null if it never fired. The practical "is it installed and working" signal.
42 43 44 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 42 def last_fired_time @last_fired_time end |
#name ⇒ Object
Returns the value of attribute name.
28 29 30 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 28 def name @name end |
#owner_ad_account_id ⇒ Object
Ad account id (act_...) that owns the tag, when reported.
60 61 62 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 60 def owner_ad_account_id @owner_ad_account_id end |
#owner_business_id ⇒ Object
Business Manager id that owns the tag, or null when the tag lives on a personal (non-BM) ad account. Such tags can't be shared with other ad accounts.
57 58 59 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 57 def owner_business_id @owner_business_id end |
#platform ⇒ Object
Returns the value of attribute platform.
30 31 32 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 30 def platform @platform end |
#site_tag_id ⇒ Object
The id the on-site code carries. Equals id on Meta; differs on platforms with separate API and site ids (OpenAI pixel_id, Google AW-... conversion id, the manager's under cross-account conversion tracking).
23 24 25 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 23 def site_tag_id @site_tag_id end |
#status ⇒ Object
inactive when the platform reports the tag as broken/unavailable.
36 37 38 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 36 def status @status end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
110 111 112 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 110 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
115 116 117 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 115 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 88 def self.attribute_map { :'id' => :'id', :'site_tag_id' => :'siteTagId', :'events' => :'events', :'name' => :'name', :'platform' => :'platform', :'kind' => :'kind', :'status' => :'status', :'code' => :'code', :'last_fired_time' => :'lastFiredTime', :'is_unavailable' => :'isUnavailable', :'installed' => :'installed', :'creation_time' => :'creationTime', :'automatic_matching_fields' => :'automaticMatchingFields', :'owner_business_id' => :'ownerBusinessId', :'owner_ad_account_id' => :'ownerAdAccountId', :'auto_tagging' => :'autoTagging' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 378 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
142 143 144 145 146 147 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 142 def self.openapi_nullable Set.new([ :'last_fired_time', :'owner_business_id', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 120 def self.openapi_types { :'id' => :'String', :'site_tag_id' => :'String', :'events' => :'Array<TrackingTagEvent>', :'name' => :'String', :'platform' => :'String', :'kind' => :'String', :'status' => :'String', :'code' => :'String', :'last_fired_time' => :'Integer', :'is_unavailable' => :'Boolean', :'installed' => :'Boolean', :'creation_time' => :'Integer', :'automatic_matching_fields' => :'Array<String>', :'owner_business_id' => :'String', :'owner_ad_account_id' => :'String', :'auto_tagging' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 342 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && site_tag_id == o.site_tag_id && events == o.events && name == o.name && platform == o.platform && kind == o.kind && status == o.status && code == o.code && last_fired_time == o.last_fired_time && is_unavailable == o.is_unavailable && installed == o.installed && creation_time == o.creation_time && automatic_matching_fields == o.automatic_matching_fields && owner_business_id == o.owner_business_id && owner_ad_account_id == o.owner_ad_account_id && auto_tagging == o.auto_tagging end |
#eql?(o) ⇒ Boolean
365 366 367 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 365 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
371 372 373 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 371 def hash [id, site_tag_id, events, name, platform, kind, status, code, last_fired_time, is_unavailable, installed, creation_time, automatic_matching_fields, owner_business_id, owner_ad_account_id, auto_tagging].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 246 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @platform.nil? invalid_properties.push('invalid value for "platform", platform cannot be nil.') end if @kind.nil? invalid_properties.push('invalid value for "kind", kind cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 400 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/zernio-sdk/models/tracking_tag.rb', line 274 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @name.nil? return false if @platform.nil? platform_validator = EnumAttributeValidator.new('String', ["metaads", "openaiads", "tiktokads", "googleads", "xads", "linkedinads", "pinterestads"]) return false unless platform_validator.valid?(@platform) return false if @kind.nil? kind_validator = EnumAttributeValidator.new('String', ["pixel", "tag", "insight_tag"]) return false unless kind_validator.valid?(@kind) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["active", "inactive"]) return false unless status_validator.valid?(@status) true end |