{"id":19270822,"url":"https://github.com/activecampaign/example-subscription_form_embed","last_synced_at":"2025-04-21T20:33:55.658Z","repository":{"id":6256394,"uuid":"7489087","full_name":"ActiveCampaign/example-subscription_form_embed","owner":"ActiveCampaign","description":"ActiveCampaign Subscription Form API Script: Embed and customize your forms on any site.","archived":false,"fork":false,"pushed_at":"2015-11-13T22:49:03.000Z","size":820,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-01T16:09:28.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ActiveCampaign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-07T20:15:39.000Z","updated_at":"2023-11-23T04:54:12.000Z","dependencies_parsed_at":"2022-07-10T17:19:54.852Z","dependency_job_id":null,"html_url":"https://github.com/ActiveCampaign/example-subscription_form_embed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveCampaign%2Fexample-subscription_form_embed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveCampaign%2Fexample-subscription_form_embed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveCampaign%2Fexample-subscription_form_embed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActiveCampaign%2Fexample-subscription_form_embed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ActiveCampaign","download_url":"https://codeload.github.com/ActiveCampaign/example-subscription_form_embed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250128523,"owners_count":21379530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T20:27:33.543Z","updated_at":"2025-04-21T20:33:55.402Z","avatar_url":"https://github.com/ActiveCampaign.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"ActiveCampaign Subscription Form API Script: Embed and customize your forms on any site.\n\n## Requirements\n\n1. [Our PHP API library](https://github.com/ActiveCampaign/activecampaign-api-php)\n2. jQuery (if using the Ajax option, or loading existing contact details)\n\n## Installation and Usage\n\nYou can install **example-subscription_form_embed** by downloading (or cloning) the source.\n\nInput your ActiveCampaign URL and API Key. Example below:\n\n\u003cpre\u003e\ndefine(\"ACTIVECAMPAIGN_URL\", \"YOUR ACTIVECAMPAIGN URL\");\ndefine(\"ACTIVECAMPAIGN_API_KEY\", \"YOUR ACTIVECAMPAIGN API KEY\");\n\u003c/pre\u003e\n\nMake sure the path to the PHP library is correct:\n\n\u003cpre\u003e\nrequire_once(\"../../activecampaign-api-php/includes/ActiveCampaign.class.php\");\n\u003c/pre\u003e\n\nSet up your subscription form embed parameters:\n\n\u003cpre\u003e\n$form_embed_params = array(\n  \"id\" =\u003e 1026,\n  \"action\" =\u003e \"\",\n  \"ajax\" =\u003e 1,\n  \"css\" =\u003e 1,\n);\n\u003c/pre\u003e\n\nHere is a breakdown of each:\n\n* `id`: The ID of your subscription form.\n* `action`: The URL that your subscription form will post data to (leave out this parameter completely if you want to post it to the default location, or set to empty string to post to the same page the script is running).\n* `ajax`: `0` or `1`. Whether or not the form submits via standard page reload, or Ajax (requires jQuery).\n* `css`: `0` or `1`. Whether or not to include (or remove) the default CSS that comes with each subscription form.\n\nFinally, decide whether to perform a sync or standard add/edit:\n\n\u003cpre\u003e\n// set to 1 to sync\n$sync = 0;\n\u003c/pre\u003e\n\nA sync does not require a subscriber ID, and will automatically add or edit, depending if they exist already (based on the email address). If you wish to simply perform an ADD (no edit), delete this portion of `Form.class.php`:\n\n![Screenshot of code to remove EDIT portion](http://d226aj4ao1t61q.cloudfront.net/pitupi0v1_1.jpg)\n\nTo load an existing contact's details in your form (name, email, and custom field values), include the **contact hash** in the URL (IE: `index.php?hash=ihfsaduh038d3q...`).\n\n![Screenshot of form filled with existing contact details](http://d226aj4ao1t61q.cloudfront.net/649ca2tr_screenshot2013-10-15at2.00.12pm.jpg)\n\n[Learn more about syncing subscribers](http://www.activecampaign.com/blog/sync-subscribers-with-our-api/).\n\n## Documentation and Links\n\n* [Full API documentation](http://activecampaign.com/api)\n* [Blog post: Advanced Subscription Form Integration](http://www.activecampaign.com/blog/advanced-subscription-form-integration/)\n\n## Reporting Issues\n\nWe'd love to help if you have questions or problems. Report issues using the [Github Issue Tracker](https://github.com/ActiveCampaign/example-subscription_form_embed/issues) or email help@activecampaign.com.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecampaign%2Fexample-subscription_form_embed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivecampaign%2Fexample-subscription_form_embed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecampaign%2Fexample-subscription_form_embed/lists"}