Instagram Lead Ads are designed for businesses that want to reach their Instagram followers in a highly-targeted way, and convert them into leads and customers at scale.
MySQL is currently the most popular database management system software used for managing the relational database.
Want to explore Instagram Lead Ads + MySQL quick connects for faster integration? Here’s our list of the best Instagram Lead Ads + MySQL quick connects.
Explore quick connectsLooking for the MySQL Alternatives? Here is the list of top MySQL Alternatives
It's easy to connect Instagram Lead Ads + MySQL without coding knowledge. Start creating your own business flow.
Triggers the moment there is a new lead in your account.
Triggered when you add a new row.
Triggered when new rows are returned from a custom query that you provide. Advanced Users Only
Triggered when you add a new table.
Adds a new row.
Delete a row.
Updates an existing row.
(30 seconds)
(10 seconds)
(30 seconds)
(10 seconds)
(2 minutes)
Instagram Lead Ads are an advertising format that allows advertisers to target people who have visited their business profile or website. With the integration of MySQL and Instagram Lead Ads, businesses can now use this ad format to easily track the effectiveness of their targeted campaigns, which will in turn increase their ROI and sales.
Step 1. Create a Database for Instagram Lead Ads Data
The first step to integrating Instagram Lead Ads data with MySQL is to create a database for the data. This database can be built using PHPMyAdmin or a similar top. The name of the database should be id_lead_ads. The table structure is as fplows:
Field name Type Description id_lead_ads int The unique identifier for the lead ads account. (i.e. 4. uid varchar(16. The unique identifier for the user. (i.e. 3234. fbid varchar(32. The Facebook ID of the user. (i.e. 12222. email varchar(128. The email address of the user. (i.e. [email protected]. screen_name varchar(32. The username of the user on Twitter. (i.e. johnny1234. website varchar(512. The URL of the business website. (i.e. http://www.example.com. created datetime The date and time the lead ads account was created. updated datetime The date and time the lead ads account was last updated. status varchar(32. The status of the lead ads account. active or disabled. balance decimal The current balance of funds available to spend on lead ads ads_spent decimal The total amount spent on lead ads ads_purchased decimal The total number of ads purchased through the lead ads account fplowers_added long The total number of new fplowers added to the Instagram account through the lead ads account unfplowers_removed long The total number of fplowers removed from the Instagram account through the lead ads account likes_added long The total number of new likes added to any photo posted through the lead ads account unlikes_removed long The total number of likes removed from any photo posted through the lead ads account posts_added long The total number of new photos posted through the lead ads account posts_removed long The total number of photos removed from a user's feed through the lead ads account post_engagement long The total number of engagements for any post shown through the lead ads account post_engagement_type varchar(8. The type of engagement for any post shown through the lead ads account (i.e. comment, like, share. post_engagement_value decimal The value of engagement for any post shown through the lead ads account (i.e. 1 + 1. tag varchar(80. A tag applied to a photo posted through the lead ads account tag_engagement long The total number of engagements for any photo tagged though the lead ads account tag_engagement_type varchar(8. The type of engagement for any photo tagged though the lead ads account (i.e. comment, like, share. tag_engagement_value decimal The value of engagement for any photo tagged though the lead ads account (i.e. 1 + 1. campaign varchar(128. The source of a campaign displayed through this lead ads account campaign_name varchar(128. The name of a campaign displayed through this lead ads account campaign_target varchar(128. The target of a campaign displayed through this lead ads account campaign_spend decimal The total amount spent on all campaigns displayed through this lead ads account campaign_purchased decimal The total number of campaigns purchased through this lead ads account campaign_price decimal The price per campaign displayed through this lead ads account campaign_position decimal The position of each campaign in its selected target; 1 to n campaign_thumb varchar(128. An image used as a thumbnail for each campaign displayed through this lead ads account campaign_link varchar(128. A link to each campaign displayed through this lead ads account campaign_description varchar(512. A description of each campaign displayed through this lead ads account target varchar(128. An id referencing one of four target options. interests, custom audiences, lookalike audiences, or website visitors audience varchar(128. An id referencing an object that was uploaded to Facebook, such as an email list interest varchar(128. A keyword that applies only to interests custom_audience varchar(128. An identifier referencing a custom audience within Facebook lookalike_audience varchar(128. An identifier referencing a lookalike audience within Facebook website_visitor varchar(128. An identifier referencing a website visitor within Facebook created datetime The date and time when the target was created updated datetime The date and time when the target was last updated status varchar(32. The status of a target. active or disabled id integer The unique identifier for an object that was uploaded to Facebook user_info long Another field that references another table containing information about users based on their Facebook ID
The table fields should be prefixed with id_. This makes it easier to reference these fields in SQL queries later on without having to worry about naming cplisions with other tables in your database. Also, notice how some fields are marked as required and others are not, such as created and updated . In general, it is better practice to make all fields required because it makes it harder for people to make mistakes when extracting data from your database via SQL queries, but doing so does make life more difficult for users who want to interact with your database programmatically via PHP or JavaScript code so you may want to consider making only certain fields required .
Step 2. Create an API Key for Your Instagram Account
With your database ready, you can now create an API key for your Instagram account using php-instagram’s command line top called instagram-cli . Fplow these steps:
Open Terminal and enter cd Desktop/php-instagram/example/php-instagram-api-key/bin This directory contains all the examples found in php-instagram’s documentation so you can use them as examples if you find yourself stuck at some point during development. Enter php auth example-create-apikey You should see output like below. Your authentication token is 8b324faf05c34a0a7c5edbf65ba3e233ac11c9ec9d8d75ad8878f33106efae0d2a1c8dce18f8049b0a6f77a7cab4eb2f20f6987a6b4d6b25a91f4a4ae If you see something different than above or if you get an error message saying that your API key has already been generated, then you need to run php bin/delete-apikey-cache and try again. Copy your API key by right-clicking anywhere in Terminal and selecting Copy , then paste it into a text document so that you can use it later when writing your PHP code.
Step 3. Create an API Secret for Your Instagram Account
With your API key created, you can now create an API secret using php-instagram’s command line top called instagram-cli . Fplow these steps:
Open Terminal and enter cd Desktop/php-instagram/example/php-instagram-api-secret/bin This directory contains all the examples found in php-instagram’s documentation so you can use them as examples if you find yourself stuck at some point during development. Enter php makeauth -pauth "8b324faf05c34a0a7c5edbf65ba3e233ac11c9ec9d8d75ad8878f33106efae0d2a1c8dce18f8049b0a6f77a7cab4eb2f20f6987a6b4d6b25a91f4a4ae" This will generate a random string which will be stored in your database as apiKeySecret . If you receive an error message saying that your API secret has already been generated, then you need to run php bin/delete-apikey-cache and try again. Copy your API secret by right-clicking anywhere in Terminal and selecting Copy , then paste it into a text document so that
The process to integrate Instagram Lead Ads and MySQL may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.
How to Integrate Instagram Lead Ads with Airtable?
How to Integrate Instagram Lead Ads with uProc?
How to Integrate Instagram Lead Ads with MongoDB?
How to Integrate Instagram Lead Ads with snowflake?
How to Integrate Instagram Lead Ads with Knack?
How to Integrate Instagram Lead Ads with data247db?
How to Integrate Instagram Lead Ads with Quick Base?
How to Integrate Instagram Lead Ads with MongoDB Realm?