### Install @elo-ads/web-sdk with pnpm Source: https://docs.elo.ad/ads/web-sdk-quickstart Install the SDK using pnpm. ```bash pnpm add @elo-ads/web-sdk ``` -------------------------------- ### Install @elo-ads/web-sdk with yarn Source: https://docs.elo.ad/ads/web-sdk-quickstart Install the SDK using yarn. ```bash yarn add @elo-ads/web-sdk ``` -------------------------------- ### Install @elo-ads/web-sdk with npm Source: https://docs.elo.ad/ads/web-sdk-quickstart Install the SDK using npm. Use your preferred package manager; equivalent commands for pnpm and yarn are also provided. ```bash npm i @elo-ads/web-sdk ``` -------------------------------- ### Full example: Chat component with EloSDK and EloAd Source: https://docs.elo.ad/ads/web-sdk-quickstart Complete example integrating the SDK in a React chat component: initializes the SDK, fetches ads on assistant messages, and renders the ad. Requires React 18 or 19 and a modern bundler. ```tsx import { EloSDK, EloAd } from '@elo-ads/web-sdk' import type { AdCreative } from '@elo-ads/web-sdk' import { useEffect, useState } from 'react' const sdk = new EloSDK({ publisherId: 'YOUR_PUBLISHER_ID', adUnitId: 'YOUR_AD_UNIT_ID', backendUrl: 'https://api.withgrowl.com', }) function Chat() { const [ad, setAd] = useState(null) const [ready, setReady] = useState(false) useEffect(() => { sdk.init().then(() => setReady(true)) }, []) async function onAssistantMessage(messages) { if (!ready) return const response = await sdk.fetchAds({ messages }) setAd(response.ad) } return (
{/* your chat UI */} {ad && }
) } ``` -------------------------------- ### Install via Package.swift Source: https://docs.elo.ad/ios/getting-started Add the SDK as a dependency in your Package.swift file, ensuring the EloAds product is added to your target. ```swift dependencies: [ .package(url: "https://github.com/growlads/elo-ios-sdk", exact: "0.5.0"), ], targets: [ .target( name: "MyApp", dependencies: [ .product(name: "EloAds", package: "elo-ios-sdk"), ], ), ] ``` -------------------------------- ### Search Request Source: https://docs.elo.ad/search-api/overview Example of a POST request to the /search endpoint using the Serper provider. ```bash curl -X POST "https://api.withgrowl.com/v1/search" \ -H "Content-Type: application/json" \ -d '{ "api_key": "elo_pub_...", "provider": "serper", "query": "travel to vietnam", "max_results": 5, "country": "us", "freshness": "month" }' ``` -------------------------------- ### Install via Swift Package Manager URL Source: https://docs.elo.ad/ios/getting-started Add the SDK to your project using the repository URL in Xcode's Add Package Dependencies dialog. ```text https://github.com/growlads/elo-ios-sdk ``` -------------------------------- ### Ad object example Source: https://docs.elo.ad/ads-api/ads Example ad object returned by the API. Shows the full structure including id, ad_group_id, campaign_id, name, status, review_status, review, creative, and timestamps. ```json { "id": "ad_67f480795c61f3e66f163c24", "ad_group_id": "adgrp_67f480455c61f3e66f163c23", "campaign_id": "cmpn_67f480125c61f3e66f163c22", "name": "Planner launch card", "status": "paused", "review_status": "in_review", "review": { "status": "in_review" }, "creative": { "title": "Plan work faster", "body": "Bring tasks, docs, and meetings together.", "target_url": "https://example.com/workspace-planner", "image_url": "https://example.com/assets/planner-card.png", "price": "$12/month" }, "created_at": 1744070521, "updated_at": 1744070521 } ``` -------------------------------- ### Provider Options Example Source: https://docs.elo.ad/search-api/overview Using the provider_options field to pass provider-specific settings, such as Exa's full page text feature. ```json { "api_key": "elo_pub_...", "query": "travel to vietnam", "provider": "exa", "provider_options": { "type": "deep", "contents": { "text": true } } } ``` -------------------------------- ### Retrieve a campaign with GET /campaigns/{campaign_id} Source: https://docs.elo.ad/ads-api/campaigns Retrieves a campaign by its ID. The response is not shown in the source. ```bash curl "https://api.withgrowl.com/v1/adm/campaigns/cmpn_67f480125c61f3e66f163c22" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" ``` -------------------------------- ### List campaigns with GET /campaigns and response Source: https://docs.elo.ad/ads-api/campaigns Lists campaigns with pagination parameters limit=20 and order=desc. The response shows a list object containing one campaign with its details, including the id, name, status, budget, targeting, and timestamps. The response is directly displayed after the request. ```bash curl "https://api.withgrowl.com/v1/adm/campaigns?limit=20&order=desc" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" ``` ```json { "object": "list", "data": [ { "id": "cmpn_67f480125c61f3e66f163c22", "name": "Spring launch", "description": "Promote the new productivity bundle.", "status": "paused", "bidding_type": "clicks", "budget": { "lifetime_spend_limit_micros": 25000000 }, "targeting": { "locations": { "include": ["US", "CA"] } }, "start_time": null, "end_time": null, "created_at": 1744070418, "updated_at": 1744070418 } ], "has_more": false, "first_id": "cmpn_67f480125c61f3e66f163c22", "last_id": "cmpn_67f480125c61f3e66f163c22" } ``` -------------------------------- ### Campaign object example Source: https://docs.elo.ad/ads-api/campaigns Example of a campaign object returned by the Ads API. Shows the fields for a campaign with a lifetime budget of 25 USD, targeting the US and Canada, and no start or end time. ```json { "id": "cmpn_67f480125c61f3e66f163c22", "name": "Spring launch", "description": "Promote the new productivity bundle.", "status": "active", "bidding_type": "clicks", "budget": { "lifetime_spend_limit_micros": 25000000 }, "targeting": { "locations": { "include": ["US", "CA"] } }, "start_time": null, "end_time": null, "created_at": 1744070418, "updated_at": 1744070418 } ``` -------------------------------- ### Initialize EloSDK and call init() Source: https://docs.elo.ad/ads/web-sdk-quickstart Create an EloSDK instance with your publisher ID, ad unit ID, and backend URL, then call init(). Read credentials from environment variables rather than hardcoding them. ```typescript import { EloSDK } from '@elo-ads/web-sdk' const sdk = new EloSDK({ publisherId: 'YOUR_PUBLISHER_ID', adUnitId: 'YOUR_AD_UNIT_ID', backendUrl: 'https://api.withgrowl.com', }) await sdk.init() ``` -------------------------------- ### configure(publisherId:adUnitId:...) Source: https://docs.elo.ad/ios/api-reference Sets up the SDK for Elo-only integrations. Call once early in your app lifecycle, typically `App.init`. Only the geo-sharing controls are mirrored here, so the on-by-default opt-out stays visible at the simplest entry point. ```APIDOC ## configure(publisherId:adUnitId:...) ### Description Sets up the SDK for Elo-only integrations. Call once early in your app lifecycle, typically `App.init`. Only the geo-sharing controls are mirrored here, so the on-by-default opt-out stays visible at the simplest entry point. ### Parameters #### Parameters - **publisherId** (`String`) - Required - Your publisher ID from Elo. - **adUnitId** (`String`) - Required - Your ad unit ID from Elo. - **shareGeoLocation** (`Bool`) - Optional - Default `true` - Passive geo sharing. On by default — pass `false` (or call `Elo.setShareGeoLocation(false)`) to opt out. The SDK never requests location permission itself. - **geoLocationPrecision** (`Int?`) - Optional - Default `2` - Decimal places used to round shared coordinates (~1.1 km at the default). `nil` keeps full precision. ### Notes `Elo.initialize(publisherId:adUnitId:coppa:tfua:shareGeoLocation:geoLocationPrecision:)` is deprecated and will be removed in 1.0. It forwards to `configure`; if you passed `coppa:` / `tfua:`, move them onto `EloConfiguration`. ``` -------------------------------- ### initialize Source: https://docs.elo.ad/android/api-reference Deprecated sugar over `configure`. Migrating is a rename for most apps; if you passed `coppa`/`tfua`, move them onto `EloConfiguration`. ```APIDOC ## initialize ### Description Deprecated sugar over `configure`. Migrating is a rename for most apps; if you passed `coppa`/`tfua`, move them onto `EloConfiguration`. ``` -------------------------------- ### Ad-group object example Source: https://docs.elo.ad/ads-api/ad-groups Example ad-group object returned by the API. Shows the required fields and their types, including the billing event type set to "click" and a max bid of 250000 micros ($0.25). ```json { "id": "adgrp_67f480455c61f3e66f163c23", "campaign_id": "cmpn_67f480125c61f3e66f163c22", "name": "Productivity shoppers", "description": "People exploring productivity tools.", "status": "active", "bidding_config": { "billing_event_type": "click", "max_bid_micros": 250000 }, "context_hints": ["productivity", "team collaboration"], "created_at": 1744070469, "updated_at": 1744070469 } ``` -------------------------------- ### GET /ads/{ad_id} Source: https://docs.elo.ad/ads-api/ads Retrieves a single ad by its ID. ```APIDOC ## GET /ads/{ad_id} ### Description Retrieves a single ad by its ID. ### Method GET ### Endpoint https://api.withgrowl.com/v1/adm/ads/{ad_id} ### Parameters #### Path Parameters - **ad_id** (string) - Required - The ad ID, prefixed with `ad_`. ### Request Example ``` curl "https://api.withgrowl.com/v1/adm/ads/ad_67f480795c61f3e66f163c24" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" ``` ### Response #### Success Response (200) - **id** (string) - Ad ID, prefixed with `ad_`. - **ad_group_id** (string) - Parent ad-group ID. - **campaign_id** (string) - Parent campaign ID. - **name** (string) - Internal ad name. - **status** (string) - `active`, `paused`, or `archived`. - **review_status** (string) - Creative review status. New ads are `in_review`. - **review.status** (string) - The same creative review status. - **creative** (object) - The complete creative. - **created_at** (integer) - Creation time as a Unix timestamp in seconds. - **updated_at** (integer) - Last update time as a Unix timestamp in seconds. #### Response Example ``` { "id": "ad_67f480795c61f3e66f163c24", "ad_group_id": "adgrp_67f480455c61f3e66f163c23", "campaign_id": "cmpn_67f480125c61f3e66f163c22", "name": "Planner launch card", "status": "paused", "review_status": "in_review", "review": { "status": "in_review" }, "creative": { "title": "Plan work faster", "body": "Bring tasks, docs, and meetings together.", "target_url": "https://example.com/workspace-planner", "image_url": "https://example.com/assets/planner-card.png", "price": "$12/month" }, "created_at": 1744070521, "updated_at": 1744070521 } ``` ``` -------------------------------- ### init(): Promise Source: https://docs.elo.ad/ads/web-sdk-api-reference Initializes the SDK. Generates a persistent visitor ID, creates a session ID, and reads IAB consent signals. Returns a status indicating readiness or missing GDPR consent. ```APIDOC ## init(): Promise ### Description Initializes the SDK. Generates a persistent visitor ID (stored in localStorage + cookie), creates a session ID, and reads IAB consent signals from localStorage. Returns `{ status: 'ready' }` or `{ status: 'gdpr_consent_missing' }` if GDPR applies but no TCF consent string is found. Calling it again starts a new session and clears the SDK's tracking state — the per-opportunity render/impression limits and the counters behind `getTrackingTotals()` — so an ad shown under the new session is never suppressed by the old one. Ads fetched before the re-init keep the bid-time identity they were requested under. ### Method init ### Endpoint `init(): Promise` ### Parameters None. ### Response #### Success Response - **status** (string) - `'ready'` or `'gdpr_consent_missing'`. #### Response Example ```json { "status": "ready" } ``` ``` -------------------------------- ### EloAdView with EloAdDisclosure Source: https://docs.elo.ad/android/api-reference Example of passing an EloAdDisclosure instance to an EloAdView component. ```kotlin EloAdView( messages = messages, sponsoredLabel = EloAdDisclosure(stringResource(R.string.elo_sponsored)), ) ``` -------------------------------- ### GET /ad_groups/{ad_group_id} Source: https://docs.elo.ad/ads-api/ad-groups Retrieves the details of a specific ad group. ```APIDOC ## GET /ad_groups/{ad_group_id} ### Description Retrieves the full object for a specific ad group. ### Method GET ### Endpoint /ad_groups/{ad_group_id} ### Parameters #### Path Parameters - **ad_group_id** (string) - Required - The ID of the ad group. ``` -------------------------------- ### configure Source: https://docs.elo.ad/android/api-reference Configures the Elo SDK. This is the single entry point and should be called once in `Application.onCreate()` or your main Activity. The convenience overload covers Elo-only integrations with geo sharing enabled by default; pass a full `EloConfiguration` for mediation adapters, COPPA/TFUA, log level, or `baseUrl`. ```APIDOC ## configure ### Description Configures the Elo SDK. This is the single entry point and should be called once in `Application.onCreate()` or your main Activity. The convenience overload covers Elo-only integrations with geo sharing enabled by default; pass a full `EloConfiguration` for mediation adapters, COPPA/TFUA, log level, or `baseUrl`. ### Method configure ### Parameters #### Convenience Overload Parameters - **context** (`Context`) - Required - Android app context. - **publisherId** (`String`) - Required - Your publisher ID from Elo. - **adUnitId** (`String`) - Required - Your ad unit ID from Elo. - **shareGeoLocation** (`Boolean`) - Optional (default `true`) - Passive geo sharing. On by default — pass `false` to opt out. The SDK never requests location permission itself. - **geoLocationPrecision** (`Int?`) - Optional (default `2`) - Decimal places used to round shared coordinates (~1.1 km at the default). `null` keeps full precision. #### Full Configuration Pass a full `EloConfiguration` for mediation adapters, COPPA/TFUA, log level, or `baseUrl`. ### Description Configures the Elo SDK. This is the single entry point and should be called once in `Application.onCreate()` or your main Activity. The convenience overload covers Elo-only integrations with geo sharing enabled by default; pass a full `EloConfiguration` for mediation adapters, COPPA/TFUA, log level, or `baseUrl`. ``` -------------------------------- ### GET /ad_groups Source: https://docs.elo.ad/ads-api/ad-groups Lists ad groups associated with a specific campaign. ```APIDOC ## GET /ad_groups ### Description Retrieves a list of ad groups for a given campaign. ### Method GET ### Endpoint /ad_groups ### Parameters #### Query Parameters - **campaign_id** (string) - Required - Parent campaign ID. - **limit** (integer) - Optional - Pagination limit. - **after** (string) - Optional - Pagination cursor. - **before** (string) - Optional - Pagination cursor. - **order** (string) - Optional - Sort order. ``` -------------------------------- ### Register AdMob adapter with Elo.configure Source: https://docs.elo.ad/ios/mediation/admob SwiftUI app entry point that creates an AdMobNetworkAdapter with an ad unit ID and expected eCPM, then configures Elo with the adapter. After this, every Elo.loadAd call runs Elo and AdMob in parallel. ```swift import SwiftUI import EloAds import EloAdsMediationAdMob @main struct MyApp: App { init() { let admob = AdMobNetworkAdapter( adUnitId: "ca-app-pub-.../...", expectedEcpm: 2.40 ) Elo.configure( with: EloConfiguration( elo: EloNetworkConfiguration( publisherId: "YOUR_PUBLISHER_ID", adUnitId: "YOUR_AD_UNIT_ID" ), adapters: [admob] ) ) } var body: some Scene { WindowGroup { ContentView() } } } ``` -------------------------------- ### Retrieve an ad with curl Source: https://docs.elo.ad/ads-api/ads Retrieves a single ad by its ID using GET /ads/{ad_id}. ```bash curl "https://api.withgrowl.com/v1/adm/ads/ad_67f480795c61f3e66f163c24" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" ``` -------------------------------- ### InitResult Source: https://docs.elo.ad/ads/web-sdk-api-reference Result of the SDK initialization, indicating whether the SDK is ready or GDPR consent is missing. ```APIDOC ## [TYPE] InitResult ### Description Result of the SDK initialization. ### Fields - **status** ('ready' | 'gdpr_consent_missing') - Required - Initialization status ``` -------------------------------- ### enable() Source: https://docs.elo.ad/ios/api-reference Enables the SDK to load and display ads. Ads are enabled by default after configuration. ```APIDOC ## enable() ### Description Enables the SDK to load and display ads. Ads are enabled by default after configuration. ### Method enable ### Request Example ```swift Elo.enable() ``` ``` -------------------------------- ### Constructor Source: https://docs.elo.ad/ads/web-sdk-api-reference Creates a new instance of the EloSDK class. Create one instance per page/app. ```APIDOC ## Constructor ### Description Creates a new instance of the EloSDK class. Create one instance per page/app. ### Method Constructor ### Endpoint `new EloSDK(config: EloConfig)` ### Parameters #### Constructor Parameters - **config** (EloConfig) - Required - Configuration object for the SDK. ### Request Example ```typescript import { EloSDK } from '@elo-ads/web-sdk' const sdk = new EloSDK(config: EloConfig) ``` ### Response No return value. ``` -------------------------------- ### GET /campaigns Source: https://docs.elo.ad/ads-api/campaigns Lists existing campaigns. Supports the shared pagination parameters limit, after, before, and order. ```APIDOC ## GET /campaigns ### Description Lists existing campaigns. Supports the shared pagination parameters limit, after, before, and order. ### Method GET ### Endpoint https://api.withgrowl.com/v1/adm/campaigns ### Parameters #### Query Parameters - **limit** (integer) - Optional - Pagination parameter to limit the number of results. - **after** (string) - Optional - Pagination parameter to return results after a given cursor. - **before** (string) - Optional - Pagination parameter to return results before a given cursor. - **order** (string) - Optional - Pagination parameter to specify sort order (e.g., desc). ### Request Example curl "https://api.withgrowl.com/v1/adm/campaigns?limit=20&order=desc" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" ### Response #### Success Response (200) - **object** (string) - The value is "list". - **data** (array) - Array of campaign objects. - **data.id** (string) - Campaign ID. - **data.name** (string) - Campaign name. - **data.description** (string) - Campaign description. - **data.status** (string) - Campaign status (active or paused). - **data.bidding_type** (string) - Bidding type (clicks). - **data.budget** (object) - Budget object. - **data.budget.lifetime_spend_limit_micros** (integer) - Lifetime spend limit in micros. - **data.targeting** (object) - Targeting object. - **data.targeting.locations** (object) - Locations object. - **data.targeting.locations.include** (array) - Array of country codes. - **data.start_time** (integer or null) - Start time as Unix timestamp. - **data.end_time** (integer or null) - End time as Unix timestamp. - **data.created_at** (integer) - Creation timestamp. - **data.updated_at** (integer) - Last update timestamp. - **has_more** (boolean) - Indicates if more results are available. - **first_id** (string) - ID of the first campaign in the list. - **last_id** (string) - ID of the last campaign in the list. #### Response Example { "object": "list", "data": [ { "id": "cmpn_67f480125c61f3e66f163c22", "name": "Spring launch", "description": "Promote the new productivity bundle.", "status": "paused", "bidding_type": "clicks", "budget": { "lifetime_spend_limit_micros": 25000000 }, "targeting": { "locations": { "include": ["US", "CA"] } }, "start_time": null, "end_time": null, "created_at": 1744070418, "updated_at": 1744070418 } ], "has_more": false, "first_id": "cmpn_67f480125c61f3e66f163c22", "last_id": "cmpn_67f480125c61f3e66f163c22" } ``` -------------------------------- ### Opt out of passive geo sharing with Elo.configure Source: https://docs.elo.ad/ads/privacy Configure the Elo SDK to opt out of passive geo sharing and set coordinate rounding precision. The iOS example uses the Swift API with publisherId and adUnitId; the Android example uses EloConfiguration with EloNetworkConfiguration. Both set shareGeoLocation to false (default is true) and geoLocationPrecision to 2 (default, ~1.1 km). ```swift Elo.configure( publisherId: "YOUR_PUBLISHER_ID", adUnitId: "YOUR_AD_UNIT_ID", shareGeoLocation: false, // opt out; default is true geoLocationPrecision: 2 // round coordinates to ~1.1 km (default) ) ``` ```kotlin Elo.configure( context = this, configuration = EloConfiguration( elo = EloNetworkConfiguration(publisherId = "...", adUnitId = "..."), shareGeoLocation = false, // opt out; default is true geoLocationPrecision = 2, // round coordinates to ~1.1 km (default) ), ) ``` -------------------------------- ### Update SDK configuration with custom backendUrl Source: https://docs.elo.ad/ads/custom-domain Initialize the EloSDK with your custom domain as the backendUrl after DNS verification succeeds. Replace YOUR_PUBLISHER_ID and YOUR_AD_UNIT_ID with your actual values. ```javascript import { EloSDK } from '@elo-ads/web-sdk' const sdk = new EloSDK({ publisherId: 'YOUR_PUBLISHER_ID', adUnitId: 'YOUR_AD_UNIT_ID', backendUrl: 'https://elo.yourdomain.com', }) ``` -------------------------------- ### Authentication error response Source: https://docs.elo.ad/ads-api/authentication Example of a 401 error response returned when an API key is missing or invalid. ```json { "error": { "message": "Missing or invalid API key in Authorization header.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" } } ``` -------------------------------- ### Web ads.txt file content Source: https://docs.elo.ad/ads/ads-txt Create a file at https://yourdomain.com/ads.txt with these two lines. Replace PUBLISHER_ID with your publisher ID from the Elo Dashboard. Both lines are required while Elo migrates from its legacy withgrowl.com seller domain. ```text elo.ad, PUBLISHER_ID, DIRECT withgrowl.com, PUBLISHER_ID, DIRECT ``` -------------------------------- ### GET /ads Source: https://docs.elo.ad/ads-api/ads Lists ads, with optional filtering by ad group. Supports shared pagination parameters. ```APIDOC ## GET /ads ### Description Lists ads, with optional filtering by ad group. Supports shared pagination parameters. ### Method GET ### Endpoint https://api.withgrowl.com/v1/adm/ads ### Parameters #### Query Parameters - **ad_group_id** (string) - Optional - Return only the ads under one ad group. - **limit** (integer) - Optional - Shared pagination parameter. - **after** (string) - Optional - Shared pagination parameter. - **before** (string) - Optional - Shared pagination parameter. - **order** (string) - Optional - Shared pagination parameter. ### Request Example ``` curl "https://api.withgrowl.com/v1/adm/ads?ad_group_id=adgrp_67f480455c61f3e66f163c23&limit=20" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" ``` ### Response #### Success Response (200) - **id** (string) - Ad ID, prefixed with `ad_`. - **ad_group_id** (string) - Parent ad-group ID. - **campaign_id** (string) - Parent campaign ID. - **name** (string) - Internal ad name. - **status** (string) - `active`, `paused`, or `archived`. - **review_status** (string) - Creative review status. New ads are `in_review`. - **review.status** (string) - The same creative review status. - **creative** (object) - The complete creative. - **created_at** (integer) - Creation time as a Unix timestamp in seconds. - **updated_at** (integer) - Last update time as a Unix timestamp in seconds. #### Response Example ``` { "id": "ad_67f480795c61f3e66f163c24", "ad_group_id": "adgrp_67f480455c61f3e66f163c23", "campaign_id": "cmpn_67f480125c61f3e66f163c22", "name": "Planner launch card", "status": "paused", "review_status": "in_review", "review": { "status": "in_review" }, "creative": { "title": "Plan work faster", "body": "Bring tasks, docs, and meetings together.", "target_url": "https://example.com/workspace-planner", "image_url": "https://example.com/assets/planner-card.png", "price": "$12/month" }, "created_at": 1744070521, "updated_at": 1744070521 } ``` ``` -------------------------------- ### Import and render the EloAd component Source: https://docs.elo.ad/ads/rendering-ads Shows how to import the EloAd component from the '@elo-ads/web-sdk' package and render it with the required sdk and ad props, plus optional className and style props. ```jsx import { EloAd } from '@elo-ads/web-sdk' ``` -------------------------------- ### GET /campaigns/{campaign_id} Source: https://docs.elo.ad/ads-api/campaigns Retrieves a specific campaign by its ID. Use this endpoint to fetch the current details of a campaign. ```APIDOC ## GET /campaigns/{campaign_id} ### Description Retrieves a specific campaign by its ID. ### Method GET ### Endpoint /campaigns/{campaign_id} ### Parameters #### Path Parameters - **campaign_id** (string) - Required - The unique identifier of the campaign. ### Request Example ``` curl "https://api.withgrowl.com/v1/adm/campaigns/cmpn_67f480125c61f3e66f163c22" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" ``` ### Response #### Success Response (200) Returns the campaign object. ``` -------------------------------- ### Retrieve an ad group with curl Source: https://docs.elo.ad/ads-api/ad-groups Retrieves a single ad group by its ID using GET /ad_groups/{ad_group_id}. ```bash curl "https://api.withgrowl.com/v1/adm/ad_groups/adgrp_67f480455c61f3e66f163c23" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" ``` -------------------------------- ### configure(with:) Source: https://docs.elo.ad/ios/api-reference Full form when you need mediation adapters, COPPA / TFUA flags, or log-level control. Subsequent calls re-configure the SDK and reset the session ID. ```APIDOC ## configure(with:) ### Description Full form when you need mediation adapters, COPPA / TFUA flags, or log-level control. Subsequent calls re-configure the SDK and reset the session ID. ### Parameters #### Parameters - **configuration** (`EloConfiguration`) - Required - Configuration object containing mediation adapters, COPPA / TFUA flags, log-level control, and other settings. ``` -------------------------------- ### Configure Elo SDK in SwiftUI Source: https://docs.elo.ad/ios/getting-started Initialize the SDK once during your app's lifecycle using Elo.configure within the App struct. ```swift import SwiftUI import EloAds @main struct MyApp: App { init() { Elo.configure( publisherId: "YOUR_PUBLISHER_ID", adUnitId: "YOUR_AD_UNIT_ID", ) } var body: some Scene { WindowGroup { ContentView() } } } ``` -------------------------------- ### Retrieve the current ad account Source: https://docs.elo.ad/ads-api/authentication Use the GET /ad_account endpoint to verify the API key and retrieve account details. ```bash curl "https://api.withgrowl.com/v1/adm/ad_account" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" \ -H "Accept: application/json" ``` ```json { "id": "67f47f965c61f3e66f163c21", "name": "Acme Ads", "created_at": 1744070400 } ``` -------------------------------- ### EloConfig Source: https://docs.elo.ad/ads/web-sdk-api-reference Configuration object for initializing the SDK, containing publisher and ad unit IDs, backend URL, and optional COPPA/TFUA flags. ```APIDOC ## [TYPE] EloConfig ### Description Configuration object for initializing the SDK. ### Fields - **publisherId** (string) - Required - Your publisher ID from the Elo Dashboard - **adUnitId** (string) - Required - Your ad unit ID from the Elo Dashboard - **backendUrl** (string) - Required - Elo ad server URL (e.g. "https://api.withgrowl.com") - **coppa** (0 | 1) - Optional - Set to 1 if your content is directed at children under 13 - **tfua** (0 | 1) - Optional - Set to 1 if tagging for users under the age of consent ``` -------------------------------- ### Create an ad with POST /v1/adm/ads Source: https://docs.elo.ad/ads-api/quickstart Creates an ad with a text creative, destination URL, and optionally an image URL and price. The response includes an ad ID like ad_67f480795c61f3e66f163c24. ```bash curl -X POST "https://api.withgrowl.com/v1/adm/ads" \ -H "Authorization: Bearer $ELO_ADS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "ad_group_id": "adgrp_67f480455c61f3e66f163c23", "name": "Planner launch card", "status": "paused", "creative": { "title": "Plan work faster", "body": "Bring tasks, docs, and meetings together.", "target_url": "https://example.com/workspace-planner", "image_url": "https://example.com/assets/planner-card.png", "price": "$12/month" } }' ``` -------------------------------- ### GET /ads/{ad_id}/insights Source: https://docs.elo.ad/ads-api/insights Retrieves insights for a single ad. Supports the same query parameters as the ad account insights endpoint. ```APIDOC ## GET /ads/{ad_id}/insights ### Description Retrieves insights for a single ad. ### Method GET ### Endpoint /ads/{ad_id}/insights ### Parameters #### Path Parameters - **ad_id** (string) - Required - The ID of the ad. #### Query Parameters - **time_granularity** (string) - Optional - `hourly`, `daily`, `monthly`, or `none`. Default: `daily`. - **aggregation_level** (string) - Optional - `ad_account`, `campaign`, `ad_group`, or `ad`. - **time_ranges[]** (string[]) - Optional - JSON-encoded time ranges. - **fields[]** (string[]) - Optional - Fields to include in each result row. - **filters[]** (string[]) - Optional - JSON-encoded filters. - **sort[]** (string[]) - Optional - JSON-encoded sort definitions. - **segments[]** (string[]) - Optional - Additional reporting breakdowns. - **override_segment_group_order[]** (string[]) - Optional - Segment grouping order. - **includes[]** (string[]) - Optional - Additional zero-result rows to include. - **limit** (integer) - Optional - From `1` to `2000`. Default: `20`. - **before** (string) - Optional - Previous-page cursor. - **after** (string) - Optional - Next-page cursor. Do not combine with `before`. ### Response #### Success Response (200) - **object** (string) - Always `"list"`. - **data** (array) - List of insight rows. During preview, empty. - **count** (integer) - Number of rows. During preview, `0`. - **first_id** (string|null) - First row ID. During preview, `null`. - **last_id** (string|null) - Last row ID. During preview, `null`. - **has_more** (boolean) - Whether more rows exist. During preview, `false`. #### Response Example ``` { "object": "list", "data": [], "count": 0, "first_id": null, "last_id": null, "has_more": false } ``` ``` -------------------------------- ### GET /campaigns/{campaign_id}/insights Source: https://docs.elo.ad/ads-api/insights Retrieves insights for a single campaign. Supports the same query parameters as the ad account insights endpoint. ```APIDOC ## GET /campaigns/{campaign_id}/insights ### Description Retrieves insights for a single campaign. ### Method GET ### Endpoint /campaigns/{campaign_id}/insights ### Parameters #### Path Parameters - **campaign_id** (string) - Required - The ID of the campaign. #### Query Parameters - **time_granularity** (string) - Optional - `hourly`, `daily`, `monthly`, or `none`. Default: `daily`. - **aggregation_level** (string) - Optional - `ad_account`, `campaign`, `ad_group`, or `ad`. - **time_ranges[]** (string[]) - Optional - JSON-encoded time ranges. - **fields[]** (string[]) - Optional - Fields to include in each result row. - **filters[]** (string[]) - Optional - JSON-encoded filters. - **sort[]** (string[]) - Optional - JSON-encoded sort definitions. - **segments[]** (string[]) - Optional - Additional reporting breakdowns. - **override_segment_group_order[]** (string[]) - Optional - Segment grouping order. - **includes[]** (string[]) - Optional - Additional zero-result rows to include. - **limit** (integer) - Optional - From `1` to `2000`. Default: `20`. - **before** (string) - Optional - Previous-page cursor. - **after** (string) - Optional - Next-page cursor. Do not combine with `before`. ### Response #### Success Response (200) - **object** (string) - Always `"list"`. - **data** (array) - List of insight rows. During preview, empty. - **count** (integer) - Number of rows. During preview, `0`. - **first_id** (string|null) - First row ID. During preview, `null`. - **last_id** (string|null) - Last row ID. During preview, `null`. - **has_more** (boolean) - Whether more rows exist. During preview, `false`. #### Response Example ``` { "object": "list", "data": [], "count": 0, "first_id": null, "last_id": null, "has_more": false } ``` ```