Google Analytics: Do I need URL address? - javascript

I am a complete Google Analytics beginner and would appreciate a help with a basic question.
I am developing HTML, CSS and JavaScript based applications which are further uploaded into an iOS application to present your applications in a fancy way. Therefore my application is a hybrid application (half JS web site, half mobile app).
I would love to see users' activity in my app when they are browsing through it and I thought GA might work well with it - but the problem is, that the outer app doesn't provide me with any URL of my inner JS app (the inner web site's URL is file:///).
At this page (link), I found that URL is not really important, that it is the tracking code which is important. So I used a dummy URL, added the GA snippet into my application and uploaded it in iPresent. I can't see no live activity though... :/ It also says the measuring is not installed (not used at a home page).
So I am wondering - is the URL really important?
Any ideas?
Thanks!

URL (or page path) is only important if you want to report on data based on which URLs your visitors went to.
If you app doesn't use URLs at all, perhaps it fits better with the "app" model where you are sending screen name data instead of page data. You can read more about the differences between web and app views here:
https://support.google.com/analytics/answer/2649553

I found out that URL is not needed. This type of problem can be solved by using GA Measurement Tool
https://developers.google.com/analytics/devguides/collection/protocol/v1/
Validate your hit here:
https://ga-dev-tools.appspot.com/hit-builder/

Related

Force facebook to open link in external browser for smart phones

How can I post a link to my website in a Facebook post, and have it open in the user's external browser when using smartphone app, not Facebook's native browser, which is not displaying properly? My page is http://www.hannabery.com
On Android, you can use Firebase Dynamic Links to let user open specific URLs by external browser. I guess that Android webview is equipped with some Firebase SDKs, so this method only works on Android. User still opens link by in-app browser on iOS.
Create a project and a domain for dynamic links
Manually create the link like: https://DOMAIN.page.link/?link=YOUR_DEST_URL
(Or there're many other ways to create links)
For example, post this link on Facebook or Messenger and try it:
https://fugle.page.link/trade-landing-page
Note: Dynamic Links are mainly used to provide consistent and smooth UX across platforms and app installs. This is just a side effect I discovered may help to answer the question, and it may not last long and so should not be taken as the final solution.
Hope that this way can help you:
var ifc = document.createElement("div");
ifc.innerHTML = `<iframe src='${browserScheme}${target}' style='width:0;height:0;border:0; border:none;visibility: hidden;'></iframe>`;
document.body.appendChild(ifc);
Full sources and example: https://github.com/huantt/force-open-browser/tree/master
https://github.com/huantt/force-open-browser/tree/master I thought this one only worked when link is sent on messenger. But any link clicked on fb messenger is going to ask what browser you prefer. I used the code on my page and I posted the link on FB and it is opened by the FB browser. How annoying :(
This cant be done (for obvious security reasons) but there are ways
1.Create an app for your website
If you create an app for your website then theres no need for facebook in the middle of things
2.Create an app displaying facebook page
As long as its your page and not something misleading then this is allowed and you can do some pretty neat stuff in android studio
for example if you post a like
mywebsite.com/forum/
theres this cool function you can use .endsWith("/forum/") from there you can make your application do ANYTHING when a link is clicked that ends with "/forum/"
A few things ive done
Redirect to that link
open browser to display link
Move to portion of app
Display dialog boxs
and theres much more your able to do
If you are having issues with your PWA not running correctly in Facebooks (insert expletive) Mobile Browser. Using dynamic links will force it out to the regular browser. Don't use your custom domain though. Use https://YOURDOMAIN.page.link instead
https://firebase.google.com/docs/dynamic-links/custom-domains
also DO NOT skip the preview page!

How to develop a Bigcommerce app that would add a javascript tag to all pages in the store?

I would like to develop an app for Bigcommerce that other users of the platform could use. The app should add a simple javascript embed code to all pages of the store. The embed code is similar in nature to google analytics embed or chat services embed codes.
I have opened up a trial account with Bigcommerce and found out that it is very easy to manually edit the page templates to add such an embed code, but I would like to be able to develop an app that store owners could install and not have to mess with editing and copy-pasting embed codes into their page templates.
Unfortunately there is no mechanism currently for BigCommerce that allows for the editing of template code via the app.
I can give you pointers as to where you can put your code to make it globally available.
If you need something in the <head> globally: /Panels/HTMLHead.html
If you need something at the beginning, right after the <body>: /Panel/DrawerMenu.html
If you need something at the end, right before the </body>: /Panels/Footer.html
These are the 3 common places most javascript things (like tracking pixels and analytics) usually go.
Other "extensions" for BigCommerce, such as OLark and Zendesk and Analytics, all just give either a web page with instructions, or a PDF with installation instructions. You could provide your functionality via the same means in lieu of an app doing it.
I haven't really worked with Bigcommerce, but I went thorough their docs and it looks like there is no option for custom module that you can upload and use on their server. And that makes perfect sense.
So I would say the only "forth to try" option is to build browser extension, that does the job for you. As I understood, you can control html output of your store by choosing "Themes" tab > "Edit HTML/CSS", so extension should be able to walk through the three of pages in the left panel.
Chrome Extension
Firefox extension

AngularJS + Parse Website Search Engine Optimization

I have developed a AngularJS Application together with a Parse.com backend (only data, no business logic). They communicate over REST.
Now my problem is, that I would like to get my page indexed by google. To reach that, I somehow have to serve all my content as static pages to make sure, Google can index it.
Now I found a nice service called getseojs.com, which does nothing else than serving all contents of my website as static content.
All i had to adjust on my side was to add a Rewrite-Condition and Rule into my .htaccess file which does nothing else than forwarding all calls containing a "_escaped_fragment_=" to the getSEOjs Service.
My only problem is, that my links arent working in the static version.
The reason is quite simple:
The URL of my AngularJS application is something like www.mydomain.com/app/
Now my links look like this:
Sample Content which is working fine in normal Browsers.
The problem is, that in the static content the domain is different. It is something like:
http://getseojs.com/v2/sdfxsaa2/://www.mydomain.com:80/app/?_escaped_fragment_=/sample/content
for the same Sample Content site. When I click on a link on the static site, I get redirected to something like:
http://getseojs.com/v2/sdfxsaa2/://www.mydomain.com:80/app/?_escaped_fragment_=/sample/content#!/othercontent
instead of
http://getseojs.com/v2/sdfxsaa2/://www.mydomain.com:80/app/?_escaped_fragment_=/othercontent
Is there any way I can avoid this? Is there no other way than working with absolute URLS? But also then I got a problem, because I need the /app/ part (cause this is were my website is placed in) and between the app part and the routes I need the hashbang (#!) oder in case of googlebot the part with "?_escaped_fragment_=".
I hope someone of you can help me. I have no idea how to solve this issue.
Thanks a lot.
Greets
Marc

Twitter Cards using Backbone's HTML5 History

I'm working on a web app which uses Backbone's HTML5 History option. In order to avoid having to code everything on the client and on the server, I'm using this method to route every request to index.html
I was wondering if there is a way to get Twitter Cards to work with this setup, as currently it can't read the page as everything is loaded in dynamically with Javascript.
I was thinking about using User Agents to detect whether it's the TwitterBot, and if it is, serving a static version of the page with the required meta-tags. Would this work?
Thanks.
Yes.
At one job we did this for all the SEO/search/facebook stuff etc.
We would sniff the user-agent, and if it was one of the following sniffers
Facebook Open Graph
Google
Bing
Twitter
Yandex
(a few others I can't remember)
we would redirect to a special page that was written to dump all the relevant data about the page for SEO purposes into a nicely formatted (but completely unstyled) page.
This allowed us to retain our google index position and proper facebook sharing even though our site was a total single-page app in backbone.
Yes, serving a specific page for Twitterbot with the right meta data markup will work.
You can test your results while developing using the card's preview tool.
https://dev.twitter.com/docs/cards/preview (with your static URL or just the tags).

Change server HTML app into self-contained desktop app

I wrote a simple web server that takes the public link to a google document containing image urls and names and outputs a print-friendly HTML photo directory with its contents.
I created it for a volunteer organization that I will no longer be able to stay involved in. I need to pass on the ability to generate that directory to my successor.
I'm not confident that I can trust myself to maintain that web application for the long term the organization needs. I'm hoping that instead I can change it to a self contained program, that members of the org could email around to whoever needed to generate the directory.
My first thought was to make a .html file the could open in a browser but I can't download the CSV data from google with Ajax, because it is cross domain. After googling there doesn't seem to be a way around this.
Is there a straightforward framework? I would guess I could do it with Adobe AIR, but I'd prefer something that simply removed the cross domain security feature.
I could take the time to embed a UIWebView into a Mac app, but since I want to write the app primarily in HTML, I'd have to create a bridge to let the web view make a cross domain request anyway right? Also it's not cross platform.
Any other ideas? How can I package my app as a desktop application instead of a web service?
You can get around the cross domain XHR using flash. CrossXhr can do it from apps served by regular http servers. I've never tried it with a static, file-served webapp. Follow the instructions here:
http://code.google.com/p/crossxhr/wiki/CrossXhr

Categories

Resources