Google analytics embedded external SWF - javascript

Here is my problem. I have a SWF file that I want to do some event tracking on in Google analytics. It has to go into a CMS and I am unable to insert the google tracking code on that page.
I am wondering if there is a method I can use perhaps using an external site and embedding the SWF in order to make calls to the Google Analytics on a remote server and track the events?
Thanks

There is a component for doing Google Analytics event tracking from within the swf, without having to insert tracking code in the page:
http://code.google.com/apis/analytics/docs/tracking/flashTrackingIntro.html

There is a way to this externally, using the External Interface or getURL methods inside flash.
They can call Javascript functions from the HTML page that contains the .swf embedded.
All you have to do is create a function that runs the code snipped from Google Analytics, and call that function from within your flash, as simple as:
getURL("javascript:Your_Function_Here");
Augusto Roselli - WebAnalytics - dp6

Related

Is it possible that the Google Script App Web App can fill a TextBox of my web page?

I'm confused with the integration of Google Script App embedded with Web App in an iFrame on my webpage to interacts with the HTML of it. I think that it is not possible to do it, but I need to ask. Google Script works perfectly, but my question is: Is it possible to make Google Web App fill a TextBox of my web page with some text? Simply that when click on a button in the Google Script run a function that can fill a text box on my website with something.
I only want to execute this but instead of "TEXT" a value of a variable from the Google Script. Thank you.
function myJsFunc() {
document.getElementsByClassName('field-element text')[0]
.setAttribute("value", "TEXT");
}
Call the Parents
You can normally use the window.parent from the iframe to access the containing web page document
function myFunc() {
window.parent.document.getElementsByClassName('field-element text')[0]
.setAttribute("value", "TEXT");
}
I can't test this on Square Space but usually content of the iframe and the webpage need to have the same origin, so if I had to guess, I would say it won't work with Apps Script.
Alternatively, it looks like Square Space does support custom JS.
You could use the Apps Script API to make a request to run a function from JavaScript.
That said, if you are just trying to .setAttribute or even something more complex, if you use the Apps Script API then you can just cut out the Apps Script step entirely. Or you use your web app as an API itself with doGet and doPost function with parameters.
References
custom JS on squarespace
Apps Script API

Event Tracking with Google Analytics in a Standalone HTML App

I work with internet connected touchscreens that can run HTML projects. The HTML projects must be self contained in that all assets like scripts, css, images, videos, etc... must be in the local file structure on the hardware in case the unit loses internet connectivity. The units have a built-in web server for this basic use with a chromium browser.
I'm wanting to track events on specified DOM elements using Google Analytics so those events can be recorded when the unit has an active internet connection.
For example... If a button is clicked to perform some sort of action on the page and in that action I want to include an audit call to send that event to my GA account. Pretty standard use of this: https://developers.google.com/analytics/devguides/collection/analyticsjs/events
However, I can't seem to figure out how to make this work on a page that isn't hosted on a typical website. Everything I'm finding doesn't deal with this specific scenario and always relies on a page hosted on a typical site.
How can I track events using Google Analytics on a standalone HTML page?
Thanks,
~Mike
Can you try with sending your events by using Google Tag Manager to Google Analytics.It is quite easy to implement.
Try with adding the Google Tag Manager code, you get once you create the account in tag manager.And add your analytics property id to a custom variable in tag manager.Then create a page view type tag with analytics property id.
sample link for your reference https://support.google.com/tagmanager/answer/6102821?hl=en
Once you are able to link tag manager to your HTML page you can start tracking the page view event.Similarly, you can track other types of events.

How to take screenshot of Google Sheet

I would like to know is there any way, screenshot could be taken in Google Sheets using Google Apps Script. I browsed I couldn't see this question or answer anywhere.
Or can it be done in any other way if not using Google Apps Script.
You will not be able to take a screenshot with apps script. It's not possible to use the HTML features others mention because of security restrictions, either your script interface runs with iframe mode, or using caja, either way you can't access the parent window and caja will block those html5 methods.
Your best option is to use Google Apps Script to convert the sheet into PDF.
If you have trouble converting to PDF, see this other answer: Google Apps Script - Create PDf from Spreadsheet produces pdf of Google sign in page.
Use a javascript library such as this:
http://www.jquerybyexample.net/2013/08/take-webpage-screenshot-html5-jquery-javascript.html
It may be in violation of Google policies though, as it is blocked by them:
Here is a tutorial that explains how can you achieve this: https://blog.rasterwise.com/how-to-take-a-screenshot-on-google-sheets/
Essentially you can use a cloud screenshot API and instrument Google App Script to invoke the API as a function in Google Sheets.
This basically allows you to have a list of URLs that you can pass as parameters of the custom function as shown in the screenshot below:

Universal Analytics tracking for embedded Flash content

We have a Flash (Flex) application embedded on a webpage. The webpage already has our Universal Analytics JavaScript code, and now we want to also track the application's events using Universal Analytics.
We can implement event tracking in the application directly using the Measurement Protocol. However, I'm wondering if that would mean that the stats coming from the application would be considered separate from what's coming from the Universal Analytics ga object on the page, i.e. not attributed to the same user/visitor.
Would it make sense to implement an approach where AS3 code would invoke methods of the page's ga JavaScript object instead?

How do you track how many sites have an actively embedded iframe widget?

I have an iframe widget that is being embedded in over 3000 third party sites, but I want to know exactly how many sites it is embedded in.
Our current method is to use google analytics to generate a list of referers, and have a script manually curl each url in the list to look for our widget.
Another method we were thinking of is to use php to print a $_SERVER['HTTP_REFERER'], and use javascript to fire an analytics event if it determines the page is in an iframe, but as the referer can be manipulated, I don't know how effective it would be.
Thanks!

Categories

Resources