PDA

View Full Version : Need PHP Help for Black THIS Out.




dusman
10-09-2011, 01:23 PM
I'm trying to finalize on a leaderboard concept for those promoting the moneybomb, but I'm having difficulty understanding how to retrieve MailChimp data and store it in a local database.

Basically, each pledge stores a referral ID in MailChimps database. I need to be able to sync those with our database so we can run queries and return a list of which referral ID provided the most pledges. I already have the sign up system and auto-generated referral pages created for the promoters.

Anyone willing to have a look at MailChimp and see how difficult it would be to tap into their API?

Cleaner44
10-09-2011, 01:27 PM
I'm trying to finalize on a leaderboard concept for those promoting the moneybomb, but I'm having difficulty understanding how to retrieve MailChimp data and store it in a local database.

Basically, each pledge stores a referral ID in MailChimps database. I need to be able to sync those with our database so we can run queries and return a list of which referral ID provided the most pledges. I already have the sign up system and auto-generated referral pages created for the promoters.

Anyone willing to have a look at MailChimp and see how difficult it would be to tap into their API?

I use MailChimp some and have some experience, but I would not pretend to be an expert. I am not sure that I understand what you are looking to do. I know that you can export the database. I don't know about syncing it though...

dusman
10-09-2011, 01:39 PM
I use MailChimp some and have some experience, but I would not pretend to be an expert. I am not sure that I understand what you are looking to do. I know that you can export the database. I don't know about syncing it though...

That would be a viable option for now I suppose.

Here is a more detailed explanation:

On BTO, for this final week we are going to have a promotion challenge. Those who want to get involved in promoting the moneybomb can sign up at BTO to get their own referral page. When they promote the moneybomb, they can link to their own page and when people pledge, they will earn a point. A leaderboard will be placed on the web site to show who is generating the most pledges, which is meant to encourage some competition and motivation to promote it more aggressively.

As of right now, I have all the other parts in place. MailChimp receives the referral ID of the page that the pledge is coming from, so I need to "count" how many each referral ID has and then display it to the leaderboard. I'm assuming I can't do this directly from the MailChimp database (unless somehow webhooks can do this), so the option seems to retrieve the data stored in the MailChimp db and pass it to a local DB that I can run queries directly to.

Syncing is not a necessity, but rather more of a convenience. I can organize a few people on hand that could export the data to our DB every hour or so in order to keep the leaderboard updated. However, that is an ugly solution.

Thoughts?

Cleaner44
10-09-2011, 01:55 PM
That would be a viable option for now I suppose.

Here is a more detailed explanation:

On BTO, for this final week we are going to have a promotion challenge. Those who want to get involved in promoting the moneybomb can sign up at BTO to get their own referral page. When they promote the moneybomb, they can link to their own page and when people pledge, they will earn a point. A leaderboard will be placed on the web site to show who is generating the most pledges, which is meant to encourage some competition and motivation to promote it more aggressively.

As of right now, I have all the other parts in place. MailChimp receives the referral ID of the page that the pledge is coming from, so I need to "count" how many each referral ID has and then display it to the leaderboard. I'm assuming I can't do this directly from the MailChimp database (unless somehow webhooks can do this), so the option seems to retrieve the data stored in the MailChimp db and pass it to a local DB that I can run queries directly to.

Syncing is not a necessity, but rather more of a convenience. I can organize a few people on hand that could export the data to our DB every hour or so in order to keep the leaderboard updated. However, that is an ugly solution.

Thoughts?

I wish I knew of an easy solution.

Maybe each refering page could drop pledges into their own Chimp list. That should be easy enough set up and then viewing the size of each list is simple. That would still require a person to issue a daily report but it would not require any counting on your part.

What do you think?

dusman
10-09-2011, 02:29 PM
Well, MailChimp has ways to do this. I just don't have the PHP understanding to get it working.

I've got about 5 PHP guys on hand, but none are online today. Hmm...

TexMac
10-09-2011, 02:36 PM
You need to get their mobile numbers so you can text them when you need them.

newbitech
10-09-2011, 03:06 PM
So do you have root access to the mailchimp database? What type of database is it? (MySQL, postgreql, MSSQL, etc..) Is the database on a remote server, and if so, do you have URI and log on information? Finally, do you know the database structure?

For instance, if I run a select on the primary key ID (referrer I am assuming) can I simply count the rows, or will I need to find a specific record where the referral count is stored?

Once we get those details ironed out, I will be able to store this information in a PHP class where you can dump it to a file, into your database, or cron it for a running total update depending on your servers cron limitations.

Let me know.

fcreature
10-09-2011, 04:00 PM
newbitech, I believe you have to work with the Mailchimp API. There is no root access to the mailchimp database as far as I'm aware.
http://apidocs.mailchimp.com/

freakout9903
10-09-2011, 04:43 PM
If each referral page is going to have it's own account, I'm assuming you can just setup a web-hook to the list to pull the subscribers and then have a script count the subscribers and output the number where you need it. Not sure if that's what your attempting to do or not.

ScotTFO
10-09-2011, 04:57 PM
http://apidocs.mailchimp.com/export/1.0/list.func.php

That API is pretty straight forward. The demo shows how to write to a file, if you need help writing that to a MySQL database instead let me know.