Building a Purple Experience
Advertisment

Embedded ads in Experience

4min
there are two ways to create embedded ads in experience using data sources using a content body component 1\ using data sources the embedded ad feature allows you to insert ads between elements at specific positions within your data source you can configure this feature using the 'ad' field by enabling the 'ad' field, you can set up embedded ads with the following configurations adid the id of the ad to be displayed interval the number of elements between each ad display after the number of elements to display before starting to show embedded ads indexed if set to true, the ad id of embedded ads will follow the structure adid index , where index represents the number of embedded ads already inserted (default is 0) startindex specifies a custom start index instead of the default value of 0 example in this example, the first embedded ad will start displaying after 2 contents its id will be traffective 5 the second ad will be displayed after 3 more contents, and its id will be traffective 6 , and so on 2\ using a content body component this method allows you to insert ads based on the amount of content in the root level of a content body to configure this, you can use the embeddedad field with the following settings adoffsetunit defines the unit for displaying the embedded ad possible values are word after a specified number of words paragraph after a specified number of paragraphs letter after a specified number of letters ads configure the ad to display here, including adconfig settings for the ad component to display counter specifies the number of units (word, character) after which an ad should be displayed indexed if set to true, the ad id will be named based on the index, resulting in an id structure of identifier + index defaults to 0 startindex if indexed is set to true, this defines the starting index any ad is always inserted between paragraphs example if you set the value for "word" to "1", the ad will not be inserted after the first word, but after the first paragraph inside content body component, ads are inserted on the topmost level to prevent interchange with other elements that might contain paragraphs, like blockquotes and figures tose will be ignored whed counting paragraphs, too example in this example, the first embedded ad will be displayed after 1000 words (just after the paragraph when reaching 1000 words) its id will be traffective 3 the second ad will be displayed after another 1000 words, with its id being traffective 4 , and so on the maximum number of ads to be displayed is 20 a