Adding Tab to Page - tabs

I am trying to add the tab to a page I am admin of.
I use the url to do that -
http://www.facebook.com/dialog/pagetab?app_id=&next=.
Facebook shows a list of all the pages I am admin of. And that drop down has no specific sorting order.
Now my problem is - I have multiple pages with same page name. They ofcourse have different urls. I tried changing the name of pages, but due to high number of likes I can't change the names.
The only option I am left with is hit & Trial. And I have to do it for more than 30 apps.
So you understand my pain point.
Please advice any alternative.
Thanks
Pankaj

I would recommend writing down the page ids and making some sort of system for yourself to remember (perhaps only the last few digits) which page is which.
In any case, there is a way for you to add a tab application directly to a page without ever seeing that "Add Page Tab" dialog. You can do it all through the API. This means you'll need your pages access token so head on over to the Graph API Explorer, make sure you click the "get access token" button and mark the manage_pages permission.
You need to query /me/accounts to get a list of all the pages you administer.
You'll see a list with the page id, name, category... I hope you will be able to identify your page more easily here. Once you have, you'll need to get the access_token for that page. Keep a record of it - we'll need it in a few minutes. You'll also need the page id.
Modify the following URL to include the parameters we got previously -
https://graph.facebook.com/PAGE_ID/tabs?app_id=TAB_APP_ID&method=post&access_token=PAGE_ACCESS_TOKEN
Navigate to that URL and if all goes well, you'll get a simple true message indicating that the action was successful.

Related

generate link with that opens pre-populated message on clicking

We have service where all user interaction is done via texting (iMessage) using Sendblue. We want users to be able to refer their friends to get free credits. The easiest way we can think of would be giving that user a link to send to their friends, which, when opened, would auto-populate a message to our number, the content of that message being the referring user's number. Example:
I (phone number +1234) want to refer my friends. I send them a link, which when they click, opens a text message to +4321 (the service) with the text prepopulated with my phone number, "+1234".
Right now the entire service is run through Zapier, so ideally would be able to work through that. You can also enter Javascript blocks into Zapier to manipulate data if that would help.
The only solution I have been able to come up with so far is create a different webpage for every person's phone number, which would just be a custom html link with the above that would be clicked automatically on page open.
Is there an existing service that does this (and ideally works with Zapier)? Or would I have to do what is described above? If so, what is the easiest way to integrate that data? Is there a way to automate webpage creation?
Any and all help is appreciated!

Facebook Graph API v2.10 page likes

disclosure. I am not a programmer
For the past year or so I have been utilizing the Facebook Graph API to pull Facebook page "likes" into a spreadsheet so that I can track how many likes my page gets vs other pages of similar business. It is kind of rudimentary but it became cumbersome to have to visit every page each week to get the total page "Likes" so this my solution.
I was utilizing this formula...
=importjson(concatenate("https://graph.facebook.com/",APINames!$B11,"?access_token=",$B$1),"/likes","noHeaders")
I reference this post...
Get Facebook page like count for OpenGraph v2.10
Which states to use the a different URL to retrieve page likes.
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=fan_count
When inputting the new URL in my formula function I still receive a reference error.
=importjson(concatenate("https://graph.facebook.com/v2.10/",APINames!$B3,"?access_token=",$B$1),"&fields=fan_count","noHeaders")
If anyone could point me in the right direction I would be very grateful. I have spent over an hour scouring the web for information as well as reading the new changelog for v2.10. I fear going back to the manual process!!
I'm not 100% sure, but you should try this:
=importjson(concatenate("https://graph.facebook.com/v2.10/",APINames!$B3,"?access_token=",$B$1,"&fields=fan_count"),"/fan_count", "noHeaders")
I think the brackets are on the wrong place, because you need to concatenate the url, the page-id (in APINames), the query parameter access_token, the access token form cell B1 and the fields query_parameter.
At least with this change I get a fan_count. Interesting use case, BTW.

What code do I add where on my site to differentiate between roots in Google Analytics?

Google analytics shows me the report for the root of my site (/), however, there are two possible roots. One for public users (and google bot), one for logged in users (like Facebook, for example).
Can I add some code, anywhere to my HTML, so that in Google Analytics I can see those two pages differentiated?
I don't want to code two different links for those two pages, for simple reasons:
I don't want/need to index the inside of my site, so I don't care that google bot doesn't know about it
I don't want my public main page to be domain.com/something
I don't want my 'logged in' main page to be domain.com/something-else
You can pass a special url for logged in users as a parameter to your track pageview call via serverside code (or a javascript funktion).
Example (assuming you use the asynchronous code):
_gaq.push(['_setAccount', 'UA-12345-1']);
_gaq.push(['_trackPageview', '/root_loggedind']);
Even though the url "/root_loggedind" does not physically exist it will register in your reports. The root for "normal" users will still register as simply "/".

How do I make a url that is specific to some set of data with out a html file?

For example, facebook. I have a list of different teams that shows overall data for that team, but the goal is the user will click on their team and send them to page that is detailed information about their team. My client wants the user's team name to be within the url so they can save the page as a favorite.
How I do this with out making a html file for every single team that gets made?
Im using Django for back end.
If you're using django then there is certainly no sense in making html for each team. You should make a template and populate this template with the data you're getting from your database (models.py) according to url (urls.py) and the appropriate view (views.py).
This is fairly basic django usage covered extensivly in the offical tutorials and the django documentation. Read it and use it, cause there is no shortcut. And last but not the least - enjoy cause such good tutorials and docs you won't see every day.

How to prevent crawlers from following links?

I'm building a site that will allow sellers to:
list their products on my site
have each product link back to the seller's site
be charged for each link clicked
What I need to do now is to somehow make sure that I am only logging actual human users following the links to the sellers site. If it's a bot crawling the site, I shouldn't be charging the sellers for that.
Is there a way for me tell bots not to follow a certain link? I don't think it's nofollow as that is not intended to block access to content.
The way to tell a bot not to follow a link is precisely to add rel=nofollow to your <a> tag.
Assuming you are also logging locally before forwarding to the external url you could also check the user agent string.
In fact, if you are going to ask people to pay based on number of referrals it might be an idea to log IP address and user agent against each paid for click in case your stats are ever questioned.
You just add a [robots.txt] file, e.g. like this one.
You can find more info about [robots.txt] files on the net, e.g. in Wikipedia.
Typicall you can identify them by the user agent string. You can find a list here, can't say it's perferct, but it's a good base to extend: PHP/MySQL - an array filter for bots
Robots.txt is another way, more about it here