Configure URL goals inside a wizard iframe that contains different urls - zend-framework

I am starting to use google analytics, and my question is the following.
I'm trying to set up different url goals, but the problem is that i have a sign up process inside an iframe, like a wizard. For google analytics, all the process happens in the same view, but inside the iframe, the url is all time changing.
I need help both to configure my goals in admin panel and what do i have to do in the code. I'm working with Zend framework.

Add the standard tracking code in the ifram html.
If your iframe is on the same domain, it works fine.
If not, see the explaination on the doc :
use JavaScript to load the iFrame and pass in the cookie information using the _getLinkerURL() method
_gaq.push(function() {
var pageTracker = _gat._getTrackerByName();
var iframe = document.getElementById('myIFrame');
iframe.src = pageTracker._getLinkerUrl('http://www.my-example-iframecontent.com/');
});

Related

Google search policy

I have question about using Google search.
Can I use a custom google search in my native iOS app instead of using their api tools, is this a problem for google?
I write html page ( http://barzyczak.vot.pl/search.html?q=test ):
<!DOCTYPE html>
<html>
<head>
<title>Element V2: Results Only Layout Demo</title>
<!-- Put the following javascript before the closing </head> tag. -->
<script>
(function() {
var cx = 'xyz';
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
})();
</script>
</head>
<body>
<!-- Place this tag where you want the search results to render -->
<gcse:searchresults-only enableOrderBy="false"></gcse:searchresults-only>
</body>
I do request to site with above content in my iOS app and receives the results. I show this results in UIWebView:
So Can I use
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationTyp
and redirect user to my UIViewController? Is this ok for Google policy?
Can I intercept/catch user's click on the link and open native application view instead of webview or should I open desired page in webview, and then redirect (with 301 code) with iOS schema URL, which open native app view (so really simulate click in google)?
Ps.
I know about Google API, but this is not ok for me.
Google's Custom Search Terms of Service (TOS) can be found at http://www.google.com/cse/docs/tos.html. I would suggest reading these thoroughly. Specifically section 1.3 which I have copied (as of 17-Mar-2013):
1.3 Your Obligations. You shall receive a Query from the End User and shall forward that Query to Google. You may not in any way frame,
cache or modify the Results produced by Google, except as otherwise
agreed to between You and Google. Google will not be responsible for
receiving Queries from End Users or for transmission of data between
You and Google's network interface. You shall be responsible for
providing all hardware and software required to perform Your
obligations under the Terms of Use, including but not limited to the
following: (a) implementing and maintaining the Site, (b) implementing
and maintaining the interface between the Site and the Service, and
(c) receiving a Query from an End User and transmitting the Query to
Google.
I am not a lawyer, but "You may not in any way frame, cache or modify the Results produced by Google, except as otherwise agreed to between You and Google." would seem important in your situation.
Unless you are paying for Google Site Search, you cannot display the results without displaying the ads.
UIWebView is similar to safari browser.
So, If you are loading ANY URL in UIWebView, then dont worry. Loading request with any url in UIWebView is as same as pasting a url in browser so there is no need to worry. But if you want to open ads of google in UIViewController or with any other control like label (eg. you are showing ads on UILabel or UITextView) then there should be problem with policies.
I am not so sure about google policy, but if you are using only UIWebView then there is no need to worry. Go ahead.........
And for google searches i have used one url that you can try....
NSString * urlString = [NSString stringWithFormat:#"https://www.google.co.in/webhp#hl=en&sugexp=les%%3B&gs_nf=1&tok=LZGxyqNyXgb5XCemHei1Fg&cp=4&gs_id=g&xhr=t&q=%#", self.txtSearch.text];
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
Hope this post will help you..............
Have a happy coding...........
EDIT:- YOU CAN NOT PERFORM MONEY TRANSACTIONS IN WEBVIEW (PROBABLY BECAUSE OF APPLE'S IN-APP PURCHASE POLICY)
From Google's current Terms of Service:
Using our Services
You must follow any policies made available to you within the
Services.
Don’t misuse our Services. For example, don’t interfere with our
Services or try to access them using a method other than the interface
and the instructions that we provide.
This, to me, is a little dubious. Whether loading search results from a URL you've constructed programatically is or is not using the interface they provide is arguable, but in my interpretation, seems ok, as long as you are loading the request in a UIWebView. If you parse the html somehow to present the results in a different fashion, such as a UITableView for example, then I think it crosses the line.
I am working on an app where I do a very similar thing to what you are attempting to do. I show the search results in a UIWebView, and if the user clicks a link, it is opened in a UIWebView in a different ViewController. But I use a different search engine, and I made the option of asking them beforehand and they agreed it was ok.

Trying to pass URL from iFrame to SharePoint site URL?

I have an application running in an iFrame that is embedded in a SharePoint site. The problem with this is navigation within the application does not result in a change in the SharePoint site URL. Therefore, if you were to refresh the overall page, you would be sent back to the default page of the application, not stay on the same page of the application. The reason this is an issue is sharing for social media. I have added a Facebook Share button to the application, but when it pulls the URL of the application which does not match or reference the URL of the overall site, so it just shares the application (which is not visually appealing and does not allow you to access the rest of the site).
Any body have any suggestions or know a place I can go for help? Thanks!
If I understand properly, the Facebook stuff is INSIDE the iframe?
If so, you can:
* Remove the iframe and integrate the application better with SharePoint, or
* Change the application so that it detects that it's running "alone" (with javascript etc), and if so redirect to the "big" application.
IF the Facebook stuff is in SharePoint, OUTSIDE of the iframe, you can write some javascript to update the URL in some way that matches the URL of the application. This requires that the SharePoint parent application and the iframe application run in the same domain - if they are not, this is not an option.
Note that changing the "parent" URL with JS will reload the page, UNLESS you only change the URL after the "#" part (so you can do something like:
"http://sharepoint/iframe.aspx?aa=11&bb=22#iframeUrl=http://uglyapplication/"
You'll also probably want to write JS to update your iframe accordingly if the user press "back"/"forward" etc in the browser, because changing the URL like above will still add a "step" to the browser history.

Facebook App to Redirect to an external website

I am trying to get an App to redirect to an external website. I have found a company who has done it (See image). If you type in their name "Safarinow" the first result comes up which is an App. When you click the app you get redirected to "http://www.safarinow.com".
Would anyone know how to achieve this?
p.s. I am not actually a developer but rather a Social media manager so I have a limited understanding of coding etc. I have just been asked to find out how to do this for the lazy dev team.
Thanks in advance
That could be done by using Javascript in your application iframe. That javascript can change the top-url like that:
window.top.location = 'http://www.my-website.com/';
You just have to run this code when your website is loaded. For example by using jQuery:
jQuery(window).load(function() { window.top.location = 'http://www.my-website.com/'; });

redirect on facebook app install

Upon install of my app on a Facebook Page, I'd like to send the user to an URL with further instructions. I'm starting the installation with http://facebook.com/add.php?api_key=app_api_key&page=page_id, which installs but redirects the user to the Facebook Page itself. It seems like various forms of redirect were available at some point:
Post-authorize callback URL. I can no longer find that in App settings.
The next parameter for add.php. I can't seem to get this to work
I have seen some apps that do redirect upon install, so I believe this is possible. Maybe it's using an old Post-authorize setting that's no longer visible?
Any help or point would be greatly appreciated! I'm also not attached to using add.php, if there's a Facebook Connect method that does this I'd use that instead (I'm looking at profile.addtab though that doesn't seem to work either).
You can set the redirect URL in the app properties. You can no longer set it from the developer control panel in Facebook, but you can still set it using the REST api.
The list of app properties is here: http://developers.facebook.com/docs/appproperties/
To set the "post_authorize_redirect_url" you would use something like this:
https://api.facebook.com/method/admin.setAppProperties?
access_token=CURRENTTOKEN&
properties={'post_authorize_redirect_url':'http://mydomain.com/post_authorize_folder/'}
I am not completely clear on this, but I believe the url needs to point to a folder, terminated with "/" rather than a specific file.
The callback gets two parameters:
installed = 1 (true)
fb_page_id = the page id when your app was installed
First page that Canvas is point to should have
< script type='text/javascript'>top.location.href = 'REDIRECT-URL';< /script>
So when your app is opened it will automaticaly redirect to REDIRECT-URL
I'm not sure that you can avoid opening of application canvas page after installing application.

facebook-share popup not getting customized for an Iframe application created with DotNet Libraries

0 vote down star
I have a .aspx page and I am creating a Facebook iframe applcation and i want to implement the share functionality on my page by using which the facebook user is able to share the contents of my page on his/her wall I using the following code to achieve this functionality
function fbs_click()
{
u="http://apps.facebook.com/shareddatas/default.aspx/";
t=document.title;
alert(u);
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
-->
**
My problem is if in the javascript function fbs_click() if i use u = "http://www"DOT"google"DOT"com" then the google image and google customized content is coming properly but if i assign the value of u = "MYaPP#FACEBOOK" then i just get apps"DOT"facebook"DOT"com on my share.php popup and what ever customized content i want to share across doesn't appear on that
Is there is a way of customizing the share.php for iframe application if not then by what means can i achieve the functionality of sharing the contents available on my page on to my wall
The whole methodology for sharing/liking has changed. I would suggest you convert over to using the new Like Plugin: https://developers.facebook.com/docs/reference/plugins/like/