Topic-icon Manual share on Timeline

Support Specialist
11 years 3 weeks ago #32310 by alzander
Replied by alzander on topic Manual share on Timeline
If the # is causing an issue, change the code to be: href="javascript:void(0);" onclick="....

For the gerar_cupom.php file, does that generate a unique page (unique URL) for each coupon, or is it loaded in a module position? For Facebook actions, each action has to be on a unique URL (an object). JFBConnect will set that type for each page, but if all the coupons have the same URL (since it's loading in a module on that page), that would be a problem.

Let me know more, or, if it's possible to let me see a URL where the coupon is generated that may help me understand more.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 3 weeks ago #32313 by acexgames
Replied by acexgames on topic Manual share on Timeline
Hi Alex

In fact, the gerar_cupom.php is something that runs in "background"... when we click in the button "Gerar cupom", it calls this PHP gerar_cupom.php which generates a new record in the coupons table, and redirects the user to "My Coupons" page...

got the point ?

Cheers
Rafael
The topic has been locked.
Support Specialist
11 years 3 weeks ago #32320 by alzander
Replied by alzander on topic Manual share on Timeline
In the "My Coupons" table, is there a unique URL for each coupon? Again, each 'object' (page/url) of your site that the user can perform an 'action' (generate a coupon) must have a unique URL. So, at the time that the coupon is generated, will you be able to determine the URL of the 'coupon' page? Is that URL a Joomla URL?

Alex
The topic has been locked.
Active Subscriptions:

None
11 years 3 weeks ago #32328 by acexgames
Replied by acexgames on topic Manual share on Timeline
Hi Alex

Each coupon has a specific CODE, which is a column in the coupons table.

In order to view a generated coupon, you should access a path, like: http://<mydomain>/visualizar_cupom.php?id=1234567890

The visualizar_cupom is not a Joomla page.

Regards,
Rafael
The topic has been locked.
Support Specialist
11 years 3 weeks ago #32334 by alzander
Replied by alzander on topic Manual share on Timeline
Gotcha. So.. one last question. I know I have a lot of questions, but the problem is that the object/url (coupon) has to be unique for each action (generate). Since you aren't using a Joomla URL for the coupon, do you have a page for the product itself that may work? So, if a user is generating a coupon for Tide Detergent, instead of using the object of the 'coupon' itself, do you have a page for 'Tide Detergent'? I think that would work better in general because you could create an action that posts something like "John generated a coupon for Tide" and then the link (in Facebook) would be to the product itself.

If you set the object to the coupon URL itself, is that something that's accessible to anyone (not logged in) *and* is that something you would want to let users/guests from Facebook to go straight to?

I think what you really want is to set the object to a product page of some sort and create a 'generate' action on those product pages. That will get Facebook users to go to the product page and give them a good incentive to join and generate their own coupon.

Hope that all helps and make sense, but as always, let us know if you have any questions.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 3 weeks ago #32343 by acexgames
Replied by acexgames on topic Manual share on Timeline
Hi Alex,

You got the point. That is EXACTLY what I want.

For example: there's a joomla page (http://<domain>/index.php/estabelecimentos/alimentacao/restaurantes/restaurantes-title/restaurante-1) for a specific restaurant (and this page is available to any user, logged in or not.

On this page, in the bottom module it's available the "Generate Coupon" button (which is available only to registered users)... I would like, every time a user clicks in that button, post on timeline "Alex generated a coupon in website_name", and this should redirect the users to the restaurant page.

Can you guide me on how to do this? :)

Thanks again,
Rafael
The topic has been locked.
Support Specialist
11 years 3 weeks ago #32362 by alzander
Replied by alzander on topic Manual share on Timeline
Rafael,
Awesome! Glad we got to the bottom of this. With that, it sounds you *do* have an Joomla URL for an Object (the product page). I'm assuming that restaurant page is a Joomla article. Let's hope so, because then this stuff should be pretty straightforward to setup:
* Install and enable the Open Graph - Content plugin
* Create a new "Article" object. Set the type to "Restauant" or whatever you want the 'product' type to be.
* Create/update the action for 'generate' and associate it to the article object created in the previous step.

Then, update your Javascript trigger to use the URL of the product page, like:
jfbc.opengraph.triggerAction("1", "http://<domain>/index.php/estabelecimentos/alimentacao/restaurantes/restaurantes-title/restaurante-1");
So, when triggered, an activity log entry will be made that the user generated a coupon for the restaurant and the link in Facebook will go to that restaurant page... the coupon itself will be shown to the user that clicked the button though and not made public to everyone.

Hope that helps get you going, but definitely keep us posted!
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 3 weeks ago #32369 by acexgames
Replied by acexgames on topic Manual share on Timeline
Sorry Alex, but, it's still not working :)

In fact, the restaurant page is not an Article.

It's a menu item with type "Jumi Application" which always call the Jumi Application Id 3...

Let me describe what I've configured (which is not working) :)

1) Object created
Extension -> custom
Layout -> custom
Name -> cupom
Object Type -> powpayrj:cupom (as in the Get Code of FB Open Graph)
Built-in Facebook Object -> Y
URL Query Parameters:
option=com_jumi
fileid=3

2) Article Created
Title -> Gerar Cupom
Action -> powpayrj:gerar (as in the Get Code of FB Open Graph)
Built-in Facebook Action -> Y
Action Type -> Manual

Both are published...

In the "Gerar Cupom" link, I've defined:
<a class="btn btn-info" href="#" onclick="jfbc.opengraph.triggerAction(1,http://www.acexgames.com.br/powpay_tmp/gerar_cupom.php?data=2013-04-07&user=376&estab=223)">Gerar Cupom</a>

I also have tried with void(0) but, nothing happens...

Kind Regards,
Rafael
The topic has been locked.
Support Specialist
11 years 3 weeks ago #32376 by alzander
Replied by alzander on topic Manual share on Timeline
For your configuration, both the action and object are *not* built-in FB Actions. Those are custom actions you've created in Facebook, so you should uncheck that box. Also, remove your namespace from the 'type', so it's just 'cupom' and 'gerar'. Facebook will automatically add the namespace where required.

As for your Javascript call, you don't have a single quote mark around the URL, which would definitely cause a Javascript error. It should look like:
onclick="jfbc.opengraph.triggerAction(1,'http://www.acexgames.com.br/powpay_tmp/gerar_cupom.php?data=2013-04-07&user=376&estab=223');"
And finally, that URL you have is again to your gerar_cupom.php page, which is not from Joomla. That should be going to the action product page that you want to post on Facebook (and that your object is configured for), like:
onclick="jfbc.opengraph.triggerAction('1', 'http://<domain>/index.php/estabelecimentos/alimentacao/restaurantes/restaurantes-title/restaurante-1');"
Hope that gets you going,
Alex
The topic has been locked.