Skip to content

Commit

Permalink
getLinkCaption
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbockt committed Sep 27, 2024
1 parent 99e2278 commit 27bd0ac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions marketing/v19/adcreative.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,21 @@ func (ac AdCreative) GetLandingPageURL() string {
return ""
}

// GetLinkCaption returns the link caption page URL of the creative.
func (ac AdCreative) GetLinkCaption() string {
if ac.ObjectStorySpec == nil {
return ""
}

if ac.ObjectStorySpec.LinkData != nil {
return ac.ObjectStorySpec.LinkData.CallToAction.Value.LinkCaption
} else if ac.ObjectStorySpec.VideoData != nil && ac.ObjectStorySpec.VideoData.CallToAction != nil && ac.ObjectStorySpec.VideoData.CallToAction.Value != nil {
return ac.ObjectStorySpec.VideoData.CallToAction.Value.LinkCaption
}

return ""
}

// ObjectStorySpec contains the media of a creative.
type ObjectStorySpec struct {
PageID string `json:"page_id,omitempty"`
Expand Down

0 comments on commit 27bd0ac

Please sign in to comment.