How to track website users using call button on website when the calls go to Twilio? - foreign-keys

I have a website which has a call button which allows users to call my contact center which receives calls via Twilio numbers.
Here's the issue. I cannot figure out how to track a lead from the website to a call. If I could somehow have the same unique ID for a user on Google Analytics and have that same unique ID for the caller who called using the call button, that would be exactly what I am looking for. Looking for programming solutions or 3rd party app solutions.
I need to see how successful leads behave on my website so that I can reinforce my business's strengths.
Thanks,
Saquib
A bit lost. Don't know where to start.

Related

Dialogflow chatbot async

I am using Dialogflow with the the V2 C# client library. When the user provides the Chatbot with an address, I use a web-hook to send the address to my back-end.
My back-end then validates the address and does some other things (my back-end takes about 2 seconds).
However, I would like the chatbot to respond to the user with something along the lines of "Give me a second and I will validate the address you provided me" before my back-end has finished.
Then once my back-end has finished, respond to the user with the results of the address validation. I don't want to accept input during the 2 seconds my back-end is processing.
In summary, I would like to know, what is the best way to acknowledge a user's input with a message, not accept any further input until my back-end processing is complete and then finally responding to the user with the results of my back-end?
You need to manage this via contexts. If you are using Dialogflow SDK instead of the UI, you could control all of this via code which is more convenient.
If you are using the GUI, set an input_context and give it some lifetime as you see fit. On your web-hook's successful resolution, update or cancel respective input_context via an output_context to demonstrate completeness of a request.
By using contexts event if user asks any other question, you will not loose previous question and its answer will still be rendered to user.
Disengaging the chatbot by not taking any questions might not be a good user experience. If you really wanted to do it, you will need some JS to help you create a loading/processing sort of icon on your bot's interface for specific intents while you programatically control the mute & unmute commands on the UI.

App not getting data from Graph API anymore & problems filling out for review

Take a breath... it's a very specific question, not directly a bug.
(But I can't get an answer from Facebook, after thousands of FAQ pages I somehow landed in a chat with Facebook Advertisers Support, they told me to come here.)
Description of my app
I have a Facebook Page, on which I'm sharing events from some other Facebook Pages I'm cooperating with. Kind of an event aggregator. The main goal is to help people who are new in town to find all that interesting events and the groups and pages they are organized by.
As you can imagine, it's based on a server-side application, that collects the upcoming events through Graph API and posts on my own Facebook Page the day before the event.
Of course I had to give the server-side application the manage_pages and publish_pages right. This Facebook App will never be used by an end-user, I'm the only user and I'm only posting to my own Facebook Page.
The server-side application worked fine for more than a year.
I just started a Facebook Ad Campaign and poster and flyers are currently being printed. And now...
What broke
You all heard of Cambridge Analytica. Due to these bad guys Facebook is currently changing a lot. One change was this:
As we begin enhancing our new app review process and make changes to our platform, the Events, Groups, Pages and Instagram APIs will no longer be available to new developers. Testing of our more robust process starts today and the new process should resume in a few weeks, but apps currently accessing Events and Groups APIs will lose access today. Going forward, access to these APIs will require a formal app review and for apps using the Pages API, submission is required within 90 days once app review resumes or access will be removed.
(See https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes)
Since nearly two weeks my server-application can't fetch events. Graph API is always returning an empty array data: [].
I have full understanding for this. Now I tried to follow these new requirements and had a look on how to submit my App for review. But that's where my struggles began:
The specific problem
The whole form for applying for review is aimed to Apps for end-users, not server-side bots.
I should provide details on why I'm using manage_pages or publish_pages. Well okay...
When selecting "automated posting" there immediatly a message pops up, telling me, that this is not allowed. Of course it is not - for applications that post in the name of persons without their knowing and aggreement. But my App is posting in the name of my own Facebook Page and I'm the only user and I'm knowing what's going to be posted. So I have to select "Other" and enter a custom description. No problem.
But at the end of the form there's asked for a Screencast! What should I make a movie of? Should I make a slideshow of my code? I can't save this form without that Screencast.
I want to be conform to the new Facebook processes, but I simply don't know how to become approved nor at least fill out for review...
I know this is not a programming question but Facebook directed me here.
So I hope I find a Facebook official or Facebook developer here. Thank you so far!

Django paypal checkout for WHOLE cart

I made a Django online-store site and I need to include paypal checkout system for the cart, but solutions I found online either just for one item only(Buy Now buttons) or something like django-paypal-cart, which is not well-documented and I can't figure out how to make it to the checkout.
Please, give me some hint, maybe good article about how to make your cart items go to the checkout, anything will be highly appreciated, I don't know what else to google now
There are numerous options for tying PayPal into your website or app. Depending on exactly what you're doing or how good you are with web service API's you may choose one or another.
If you want to keep things simple, you can stick with Payments Standard. This is basically what you're referring to about the one item only buy now button, but you can use the cart upload command method to build a form that includes multiple items and pass it all over to PayPal at once.
If you prefer web service API's I'd recommend using Express Checkout. This consists of SetExpressCheckout, GetExpressCheckoutDetails, and DoExpressCheckoutPayment. Read through that general EC documentation to get familiar with the calls and how it all flows.
Another thing I would highly recommend utilizing is Instant Payment Notification (IPN). This is a feature where PayPal will POST transaction data to a listener script that you have sitting on your server any time a transaction occurs on your PayPal account. This includes payments, refunds, disputes, cleared payments that were pending, etc. This allows you to automate tasks like updating your database, sending out custom email notifications, hitting 3rd party web services, etc. and it happens in real-time, so it's very powerful.

Facebook integration... Where to start?

I recently put a django project of mine into its beta stages and would really like to integrate more with social media, particularly facebook.
Now there are so many facebook integrations out there... I don't know where to start but, I'll tell you what I am after.
My sites publishes content with photos and also user related data (which site doesn't)
on each individual page I already have a facebook like button that basically has the absolute url of that page
so for instance:
http://my-site.com/url-1
http://my-site.com/url-345345
http://my-site.com/url-456456456
When a user likes this particular url I would like them to become a Fan on my facebook site/page as well.
I also added the FB opengraph tool which is a bit more informative once a user likes it. But it still does not publish any statistics to my page.
Can someone give me a bit of an understanding on what the best option is for this type of integration?
As a security option for the user, Facebook has never allowed third party access to "become a fan."
If you want to record locally when someone presses the "Like" button, you'll have to implement it locally (copy the presentation, and query Facebook yourself), so you can intercept the event. I've done that; it's not too hard.
I suggest you review the Connect Terms of Service to see what it is you're allowed to do: http://developers.facebook.com/policy/

Prevent anyone from executing your web service?

I've got a webservice which is executed through javascript (jquery) to retrieve data from the database. I would like to make sure that only my web pages can execute those web methods (ie I don't want people to execute those web methods directly - they could find out the url by looking at the source code of the javascript for example).
What I'm planning to do is add a 'Key' parameter to all the webmethods. The key will be stored in the web pages in a hidden field and the value will be set dynamically by the web server when the web page is requested. The key value will only be valid for, say, 5 minutes. This way, when a webmethod needs to be executed, javascript will pass the key to the webmethod and the webmethod will check that the key is valid before doing whatever it needs to do.
If someone wants to execute the webmethods directly, they won't have the key which will make them unable to execute them.
What's your views on this? Is there a better solution? Do you forsee any problems with my solution?
MORE INFO: for what I'm doing, the visitors are not logged in so I can't use a session. I understand that if someone really wants to break this, they can parse the html code and get the value of the hidden field but they would have to do this regularly as the key will change every x minutes... which is of course possible but hopefully will be a pain for them.
EDIT: what I'm doing is a web application (as opposed to a web site). The data is retrieved through web methods (+jquery). I would like to prevent anyone from building their own web application using my data (which they could if they can execute the web methods). Obviously it would be a risk for them as I could change the web methods at any time.
I will probably just go for the referrer option. It's not perfect but it's easy to implement. I don't want to spend too much time on this as some of you said if someone really wants to break it, they'll find a solution anyway.
Thanks.
Well, there's nothing technical wrong with it, but your assumption that "they won't have the key which will make them unable to execute them" is incorrect, and thus the security of the whole thing is flawed.
It's very trivial to retrieve the value of a hidden field and use it to execute the method.
I'll save you a lot of time and frustration: If the user's browser can execute the method, a determined user can. You're not going to be able to stop that.
With that said, any more information on why you're attempting to do this? What's the context? Perhaps there's something else that would accomplish your goal here that we could suggest if we knew more :)
EDIT: Not a whole lot more info there, but I'll run with it. Your solution isn't really going to increase the security at all and is going to create a headache for you in maintenance and bugs. It will also create a headache for your users in that they would then have an 'invisible' time limit in which to perform actions on pages. With what you've told us so far, I'd say you're better off just doing nothing.
What kind of methods are you trying to protect here? Why are you trying to protect them?
ND
MORE INFO: for what I'm doing, the visitors are not logged in so I can't use a session.
If you are sending a client a key that they will send back every time they want to use a service, you are in effect creating a session. The key you are passing back and forth is functionally no different than a cookie (expect that it will be passed back only on certain requests.) Might as well just save the trouble and set a temporary cookie that will expire in 5 minutes. Add a little server side check for expired cookies and you'll have probably the best you can get.
You may already have such a key, if you're using a language or framework that sets a session id. Send that with the Ajax call. (Note that such a session lasts a bit longer than five minutes, but note also it's what you're using to keep state for the users regular HTPP gets and posts.)
What's to stop someone requesting a webpage, parsing the results to pull out the key and then calling the webservice with that?
You could check the referrer header to check the call is coming from one of your pages, but that is also easy to spoof.
The only way I can see to solve this is to require authentication. If your webpages that call the webservice require the user to be logged in then you can check the that they're logged in when they call the webservice. This doesn't stop other pages from using your webservice, but it does let you track usage more and with some rate limiting you should be able to prevent abuse of your service.
If you really don't want to risk your webservice being abused then don't make it public. That's the only failsafe solution.
Let's say that you generate a key valid from 12.00 to 12.05. At 12.04 i open the page, read it with calm, and at 12.06 i trigger action which use your web service. I'll be blocked from doing so even i'm a legit visitor.
I would suggest to restrain access to web services by http referrer (allow only those from your domain and null referrers) and/or require user authentication for calling methods.