### Get PHP Setup Information Source: https://docs.adspect.ai/en/latest/_sources/overview.md.txt Use this PHP script to retrieve information about your current PHP configuration, including installed extensions. ```php "> This is a link to the offer ``` -------------------------------- ### Basic API Request Example Source: https://docs.adspect.ai/en/latest/api.html Illustrates the base URL and relative path for a GET request to the streams endpoint. ```text GET /streams ``` -------------------------------- ### Click Log Row Example Source: https://docs.adspect.ai/en/latest/api.html Example of a single row from the click log, formatted as a JSON array. The order of elements matches the 'columns[]' parameters requested. ```json ["2024-04-01 00:00:00", "23.83.90.68", "US", 0] ``` ```json ["2024-04-01 00:00:00", "2a03:2880:30ff:8::33", "SE", 0] ``` ```json ["2024-04-01 00:00:00", "47.128.19.245", "SG", 0] ``` ```json ["2024-04-01 00:00:00", "176.223.109.119", "US", 0] ``` ```json ["2024-04-01 00:00:00", "2a03:2880:20ff:76::33", "US", 0] ``` ```json ["2024-04-01 00:00:00", "89.248.163.208", "NL", 0] ``` ```json ["2024-04-01 00:00:00", "47.128.98.197", "SG", 0] ``` ```json ["2024-04-01 00:00:00", "47.128.25.161", "SG", 0] ``` ```json ["2024-04-01 00:00:00", "95.90.237.130", "DE", 0] ``` ```json ["2024-04-01 00:00:00", "176.5.15.114", "DE", 0] ``` -------------------------------- ### Reporting Filters Example Source: https://docs.adspect.ai/en/latest/api.html Example demonstrating how to use URL parameters to filter reporting data. Parameters ending with '[]' support multiple values for OR conditions. ```http date_from=1672520400&date_to=1675198800&country_code[]=AE&os[]=iOS&os[]=macOS ``` -------------------------------- ### Example Click Cost URL Parameter Source: https://docs.adspect.ai/en/latest/_sources/streams.md.txt Example of a click URL with a cost parameter. Adspect can extract this value if specified in the Click Cost field. ```html https://example.com/?cost=0.15 ``` -------------------------------- ### PHP Reverse Integration Setup Source: https://docs.adspect.ai/en/latest/integration.html Include this line at the very beginning of your PHP file to enable Adspect's filtering. Ensure filter.php is in the same directory. ```php ``` -------------------------------- ### Install php-curl on Debian/Ubuntu Source: https://docs.adspect.ai/en/latest/_sources/troubleshooting.md.txt Use this command to install the php-curl extension on Debian-based systems like Ubuntu. This extension is required for Adspect to function correctly. ```bash apt-get install php-curl ``` -------------------------------- ### GET /streams Source: https://docs.adspect.ai/en/latest/api.html Retrieve a list of streams. This is a basic example of an endpoint description. ```APIDOC ## GET /streams ### Description Retrieve a list of streams. ### Method GET ### Endpoint `/streams` ### Parameters #### Query Parameters * **limit** (integer) - Optional - Maximum number of streams to return. * **offset** (integer) - Optional - Number of streams to skip before starting to collect the result set. ### Response #### Success Response (200) * **streams** (array) - An array of stream objects. * **id** (integer) - The unique identifier for the stream. * **name** (string) - The name of the stream. * **status** (string) - The current status of the stream (e.g., 'active', 'paused'). #### Response Example ```json { "streams": [ { "id": 1, "name": "Example Stream 1", "status": "active" }, { "id": 2, "name": "Example Stream 2", "status": "paused" } ] } ``` ``` -------------------------------- ### Local File Action with Query Parameters Source: https://docs.adspect.ai/en/latest/streams.html Use this to pass macros as GET parameters to your local file. Access them in PHP using the $_GET superglobal. ```html page.php?cid={clickid} ``` -------------------------------- ### Install php-curl on CentOS/Red Hat Source: https://docs.adspect.ai/en/latest/_sources/troubleshooting.md.txt Use this command to install the php-curl extension on CentOS or Red Hat systems. This extension is necessary for Adspect's operations. ```bash yum install php-curl ``` -------------------------------- ### Example Tel URL Source: https://docs.adspect.ai/en/latest/streams.html A tel URL that initiates a phone call on devices with telephony support. ```text tel:+08001234567 ``` -------------------------------- ### Parameter Passthrough Example Source: https://docs.adspect.ai/en/latest/_sources/streams.md.txt Demonstrates how URL parameters from an incoming URL are appended to the money page URL when Parameter Passthrough (PT) is enabled. ```text https://example.com/?utm_campaign=sweeps ``` ```text https://tracker.test/lander/index.php?utm_medium=ppc&utm_source=search ``` ```text https://example.com/?utm_campaign=sweeps&utm_medium=ppc&utm_content=search ``` -------------------------------- ### Example Market URL Source: https://docs.adspect.ai/en/latest/streams.html A market URL that directs users to a specific app's page in the Google Play Store. ```text market://details?id=app ``` -------------------------------- ### Example Absolute Local Path for Money Page Source: https://docs.adspect.ai/en/latest/streams.html An absolute path to a local file or directory, treated as relative to the website's root directory. ```text /landers/landing.html ``` -------------------------------- ### Example URL with Adspect Macros Source: https://docs.adspect.ai/en/latest/streams.html Demonstrates how to use Adspect macros within a URL for tracking and routing purposes. Values are URL-encoded when used in money/safe pages. ```URL https://example.com/offer?clickid={clickid}&geo={country}&os={os} ``` -------------------------------- ### IP/ASN List Format Example Source: https://docs.adspect.ai/en/latest/api.html Illustrates the format for IP address ranges and ASNs when retrieving or submitting lists. Supports various notations including CIDR and ranges. ```json [ "192.0.2.1", "192.0.2.0/24", "192.0.2.0-192.0.2.255", "2001:db8::1", "2001:db8::/112", "2001:db8::-2001:db8::ffff", "65536", "AS65536", "1.10", "AS1.10" ] ``` -------------------------------- ### Example Mailto URL Source: https://docs.adspect.ai/en/latest/streams.html A mailto URL that triggers the default email client to compose a new email. ```text mailto:user@example.com ``` -------------------------------- ### Get Integration Files Source: https://docs.adspect.ai/en/latest/_sources/api.md.txt Retrieves integration files (index.php, filter.php, ajax.php) for a specific stream. ```APIDOC ## GET /streams//file ### Description This endpoint returns integration files `index.php`, `filter.php`, and `ajax.php` for the stream specified by ``. ### Method GET ### Endpoint /streams//file ### Parameters #### Query Parameters - **name** (String) - Required - The name of the integration file to retrieve (e.g., `index.php`, `filter.php`, `ajax.php`). ``` -------------------------------- ### Parameter Passthrough Example: Incoming Visitor URL Source: https://docs.adspect.ai/en/latest/streams.html The URL a visitor uses to access the Adspect tracker, containing parameters that may be passed through to the money page. ```text https://tracker.test/lander/index.php?utm_medium=ppc&utm_source=search ``` -------------------------------- ### Example Click Cost Extraction from URL Source: https://docs.adspect.ai/en/latest/streams.html Extract cost information from URL parameters to calculate expenses in Adspect reports. If empty, clicks have zero cost. ```html {p:cost} ``` -------------------------------- ### Example Click ID Macro Usage Source: https://docs.adspect.ai/en/latest/streams.html Add the Click ID to money or safe page links using this macro. ```html {clickid} ``` -------------------------------- ### AdsSpect AI Stream Configuration Example Source: https://docs.adspect.ai/en/latest/_sources/api.md.txt This JSON object represents a full configuration for an AdsSpect AI stream, including settings for pages, filters, scheduling, and targeting. ```json { "stream_id": "1eacc6d0-875f-6f5c-bff8-00162501c2b4", "account_id": "1eaa2ce5-d4dd-63ec-b8a4-00162501c2b4", "name": "Example Stream", "tags": ["Tag1", "Tag2"], "mode": "Filter", "notes": "This is an example comment.", "money_pages": [ { "page": "https://example.com/offer1?clid={clickid}", "action": "302", "arg_passthru": true, "weight": 10, "enabled": true }, { "page": "https://example.com/offer2?clid={clickid}", "action": "302", "arg_passthru": true, "weight": 20, "enabled": true } ], "rotator": "Split", "safe_pages": [ { "page": "safe.html", "action": "local", "arg_passthru": true } ], "skip_clicks": 30, "skip_clicks_mode": "all", "filter_level": "High", "enable_fp": true, "enable_ua": true, "require_unique": true, "require_touch": false, "require_web3": false, "allow_apps": false, "allow_embed": true, "allow_google_proxy": false, "allow_apple_proxy": true, "countries": ["AE", "HK"], "os": ["iOS", "macOS"], "browsers": ["Google Chrome"], "engines": ["Blink"], "languages": ["en", "fr", "es"], "require_language": true, "sub_id": "{p:utm_campaign}", "click_id": "{p:gclid}", "click_cost": "0.15", "ip_list_mode": "black", "ip_on_review": true, "extrapolate_ipv4": 0, "extrapolate_ipv6": 0, "ua_list_mode": "black", "ua_blacklist": [ "^Mozilla/4" ], "ua_whitelist": [], "ref_list_mode": "white", "ref_blacklist": [], "ref_whitelist": [ "google\.com" ], "url_rules": [ { "param": "gclid", "op": "REGEX", "arg": ".{30,}", "enabled": true } ], "schedule": [ { "days": ["Sun", "Sat"], "since": "15:30:00", "till": "22:15:00" } ], "timezones": [-5, -6, -7], "tz_match_ip": true } ``` -------------------------------- ### GET /streams Source: https://docs.adspect.ai/en/latest/api.html Retrieves a list of streams configured in the account. The list is paginated and ordered by stream name in ascending lexicographic order. ```APIDOC ## GET /streams This endpoint returns a list of streams configured in the account. The list is paginated and ordered by stream name in ascending lexicographic order. ### Supported URL parameters: | Parameter | Type | Default Value | Description | |---|---|---|---| | `page` | Integer | 1 | Number of page to display. | | `per-page` | Integer, from 1 to 100 | 20 | Number of streams per page. | | `name` | String | None | Output only streams whose names contain the specified substring (case-insensitive). | ``` -------------------------------- ### Example Sub ID Macro Usage Source: https://docs.adspect.ai/en/latest/streams.html Use this macro in your campaign URL to pass zone identifiers. Adspect can then track reports per zone. ```html https://example.com/?subid={zoneid} ``` -------------------------------- ### Sales Funnel Group By Example Source: https://docs.adspect.ai/en/latest/_sources/api.md.txt Use multiple 'group_by[]' parameters to create a hierarchical breakdown in the sales funnel report. The order of parameters determines the order of breakdown. ```http group_by[]=date&group_by[]=stream_id ``` -------------------------------- ### Reporting API Filters Example Source: https://docs.adspect.ai/en/latest/_sources/api.md.txt Use URL parameters to filter reporting data by date, country, and operating system. Parameters ending with '[]' support multiple values for an OR condition. ```http date_from=1672520400&date_to=1675198800&country_code[]=AE&os[]=iOS&os[]=macOS ``` -------------------------------- ### Parameter Passthrough Example: Money Page URL Source: https://docs.adspect.ai/en/latest/streams.html The base URL for a money page, which will have incoming URL parameters appended if Parameter Passthrough (PT) is enabled. ```text https://example.com/?utm_campaign=sweeps ``` -------------------------------- ### GET /reports/ - Get Specific Saved Query Source: https://docs.adspect.ai/en/latest/_sources/api.md.txt Retrieves a single saved query by its unique identifier. ```APIDOC ## GET /reports/ ### Description Retrieves the saved query specified by its ID. ### Method GET ### Endpoint /reports/ ### Path Parameters - **ID** (String) - Required - The unique identifier of the saved query. ### Response Example (Success - 200) ```json { "query_id": "878efbf1-0fb9-4c69-ad36-40e714b0eeeb", "owner_id": "1eb5991f-a25b-68f4-b171-00162501c2b4", "date_from": 1577836800, "date_to": null, "time_zone": "Asia/Dubai", "group_by": [], "stream_id": ["6792f6ce-f153-439f-b223-f58749f1210f"], "ip_address": [], "asn": [], "country_code": ["HK", "AE"], "os": ["iOS", "macOS"], "browser": ["Apple Safari"], "engine": [], "sub_id": [], "click_id": [], "mode": ["Filter"], "target": [] } ``` ``` -------------------------------- ### Obtain Per-Day Sales Funnel Metrics for a Specific Stream Source: https://docs.adspect.ai/en/latest/api.html This example demonstrates how to fetch daily sales funnel metrics for a particular stream ID, including clicks, money hits, safe hits, and quality. It allows for detailed analysis of a stream's performance over time. ```HTTP GET /reports/funnel?group_by[]=date&metrics[]=clicks&metrics[]=money_hits&metrics[]=safe_hits&metrics[]=quality&stream_id[]=07ac03df-268e-41ff-84ba-adfe2241beb2 ``` ```JSON ["2024-04-01", "931", "343", "582", 0.3684210526315789] ["2024-04-02", "1166", "829", "300", 0.7109777015437393] ["2024-04-03", "1113", "855", "243", 0.7681940700808625] ["2024-04-04", "9", "7", "0", 0.7777777777777778] ``` -------------------------------- ### Get Stream Source: https://docs.adspect.ai/en/latest/_sources/api.md.txt Retrieves a specific stream by its ID. ```APIDOC ## GET /streams/ ### Description This endpoint returns the stream specified by ``. ### Method GET ### Endpoint /streams/ ``` -------------------------------- ### Get Query API Source: https://docs.adspect.ai/en/latest/api.html This endpoint returns the query specified by . ```APIDOC ## GET /reports/ ### Description This endpoint returns the query specified by . ### Method GET ### Endpoint /reports/ ### Parameters #### Path Parameters - **ID** (string) - Required - The ID of the query to retrieve. ``` -------------------------------- ### Get Specific Query Endpoint Source: https://docs.adspect.ai/en/latest/api.html Retrieve a specific query using its unique identifier. ```http GET /reports/ ``` -------------------------------- ### Get Specific Stream Source: https://docs.adspect.ai/en/latest/api.html Retrieve details for a specific stream using its unique identifier. ```http GET /streams/ ``` -------------------------------- ### Example Local Path for Money Page Source: https://docs.adspect.ai/en/latest/streams.html A relative path to a local file or directory on the same server as the Adspect PHP file. This path will be resolved relative to the website's root directory. ```text page.php ``` -------------------------------- ### GET /reports/funnel Source: https://docs.adspect.ai/en/latest/_sources/api.md.txt Retrieves funnel metrics. Can be grouped by stream ID or date, and filtered by various metrics and stream IDs. ```APIDOC ## GET /reports/funnel ### Description Retrieves funnel metrics, allowing grouping by stream ID or date, and filtering by specific metrics and stream IDs. ### Method GET ### Endpoint /reports/funnel ### Query Parameters - **group_by[]** (string) - Required - Specifies the field to group the results by (e.g., `stream_id`, `date`). - **metrics[]** (string) - Required - Specifies the metrics to retrieve (e.g., `clicks`, `money_hits`, `safe_hits`, `quality`). - **stream_id[]** (string) - Optional - Filters results for specific stream IDs. - **date** (string) - Optional - Filters results for a specific date. ### Request Example ```json GET /reports/funnel?group_by[]=stream_id&metrics[]=clicks&metrics[]=money_hits&metrics[]=safe_hits&metrics[]=quality ``` ### Response #### Success Response (200) - An array of arrays, where each inner array contains the grouped value and the requested metrics. #### Response Example ```json ["1ec5880e-bcb6-49b8-9778-a31d22b70708", "1453", "754", "699", 0.5189263592567103] ["07ac03df-268e-41ff-84ba-adfe2241beb2", "3219", "2034", "1125", 0.6318732525629077] ``` ``` -------------------------------- ### PHP API Key Encoding Source: https://docs.adspect.ai/en/latest/api.html Demonstrates how to encode an API key for use in the Authorization header using PHP. ```php