How would you go about writing a custom script that grabs the Adobe or Google Analytics image request? - google-analytics

If I wanted to build a scraper that pings each URL on a site and stores the adobe (or Google) image request, how would I go about this? I.e. I just want something that grabs all the parameters in the URL posted to Adobe in a csv or something similar. I'm familiar with how to build simple web scrapers, but how do I grab the URL I see in for example Fiddler that contains all the variables being sent to the Analytics solution?
If I could do this I could run a script that lists all URLs with the corresponding tracking events that are being fired and it would make QAing much more manageable.

You should be able to query the DOM for the image object created by the tag request. I am more familiar with the IBM Digital Analytics (Coremetrics) platform and you can find the tag requests using accessing the following array document.cmTagCtl.cTI in the Web Console on a Coremetrics tagged page. I used this method when building a Selenium WebDriver test case and wanted to test for the analytics tags.
I don't have the equivalent for Adobe or GA at the moment since it depends in the library implementation am trying the do the same as you for GA.
Cheers,
Jamie

Related

How to track a PDF view (not click) on my website using Google Tag Manager

How can I track that someone visited the following URL of my website http://www.website.com/mypdf.pdf.
I tried using a Page View trigger on a Page View tag. I'm completely new at Google Analytics so not sure how to proceed. Most people are going to be going to that pdf directly via URL, as there is no link to it on my website, but I really want to be able to track how many people view it.
Thanks in advance!
You cannot track PDF views with the help of GTM. GTM for web is a javascript injector, and one cannot inject Javascript into a PDF document from the browser.
One way to circumvent this is to have a gateway page, i.e. have the click go to a HTML page that counts the view before redirecting to the document in question (naturally you could use GTM in that page). Since people go directly to the PDF URL this would require a bit of scripting - you would have to redirect all PDF links to your gateway page via a server directive, count the view and then have the page load the respective document.
Another even more roundabout way would be to parse your server log files and send PDF requests to GA via the measurement protocol (actually many servers allow to have log writes redirected to another script, so you could do this in realtime). I would not really recommend that approach - it's technologically interesting, but probably more effort than it is worth.
The short version is, if you are not comfortable fiddling a little with your server setup you will probably not be able to track pdf views. GTM does not work on PDF files.
Facing same issue…
My solution was to use url shortener (like bitly.com) which includes opening statistics.
Not the perfect solution but it works for direct pdf access from external source (outside your site).

Google Analytics Receiving Data -- but no analytics in view source

My client created a website and a google analytics account. The report indicates that the account is receiving data -- and yet, when we do a view-source of the pages of the site, there is definitely absolutely no analytics code there. How is this posssible?
It is possible that the Analytics code is added via Javascript, not appearing in the "View Source" page. It is also possible for it not to appear in the inspector either.
I do not know how this happens, but I have encountered scripts that exist and run although they are not displayed in either the source page or the live DOM inspector (in Google Chrome). This happened to me while loading a PHP template containing Javascript through an Ajax request.
If you have access to the source code of your website, search the entire project for for the Analytics ID (Here's how to find it: https://support.google.com/analytics/answer/1032385?hl=en), and you'll locate your tracking code.
If your project is running on a Linux server, here's a post about how to quickly find a keyword (like the Analytics ID) in a folder: How do I find all files containing specific text on Linux?

Linking to Google Maps from Desktop App

I want to provide a button in my commercial Windows Forms desktop application which just opens a link to maps.google.com (Google Maps) in a webbrowser control or in the user's default Web Browser with the start and destination address populated. I just String.Format the parameters into a URL, I end up with a URL like this:
http://maps.google.com/maps?saddr=SUNBURY+Victoria+Australia&daddr=MORNINGTON+Victoria+Australia
and then open that URL with the webbrowser control, or associated app calling Process.Start and passing in the URL, like this:
Dim URL as String = "http://maps.google.com/maps?saddr=SUNBURY+Victoria+Australia&daddr=MORNINGTON+Victoria+Australia"
If _useWebBrowser then
webbrowser1.Navigate(URL)
Else
Dim sInfo As New ProcessStartInfo(URL)
Process.Start(sInfo)
End If
I am not using the API here (am I?), just linking to the Google's maps site with a URL with a start and end address, but I am now worried this might violate terms of service of some kind. I can't find any good definition of this anywhere.
The closest I can find, on the Google "Permissions" page for Maps, everything else relates to use of the APIs:
http://www.google.com.au/permissions/geoguidelines.html
Feel free to use a hyperlink on your website or within your application to send users to Google Maps — we appreciate it! Our one request is that you do not use the Google or Google Maps logos as the hyperlink. Please just use text or another image of your choice.
Can I legally create a URL programmatically, and call that URL in a webbrowser control, IE, Chrome, etc?
I am completely confused.
So you just have a link that opens the Google Maps website in a web browser (which includes a webbrowser control)? And you're not using a Google logo for the link? That's fine! As they said, they appreciate it. :-)
Generating the link dynamically doesn't change that. And no, you're not using the Maps API, so the API terms of service don't apply.

Rss and external feed

I want to build a similar app like this:http://community.livejournal.com/ohnotheydidnt/32551171.html
using a livejournal rss feed. Any way of retrieving an external feed ( meaning getting a feed from a different domain that the one your web application-Same origin policy)? I've built a parser, but I would like to use dashcode for simple html building.
Across domains, if the data is only available via RSS and you don't have control of the other domain, then your best option is a server-side proxy.
If you have control over the other domain, you can create a page containing a javascript function which uses XmlHttpRequest to pull the RSS and returns the RSS. Then you can use a cross-domain messaging library like EasyXDM to call that script.
You also might want to check if the RSS feed's website supports JSONP as an alternate format, which would allow you to get the RSS data via javascript. Make sure you trust the site if you do this, though, since the site can execute javascript inside your page!

How can I show my google analytics traffic report via asp.net or classic asp?

How can I show my google analytics traffic report (AKA 'View Report') via asp.net or classic asp?
There are several APIs for querying data from Analytics. For example in both JavaScript and C#. See the developer guide for more information.
I don't think there is an easy way to just include their report into an existing page. You would have to use the APIs.
you can use the google data APIs to pull feed data as xml look at this tool it lets you run text queries and see the results
then make a call to data feed and parse with Server.CreateObject("MSXML2.DomDocument.3.0") to output the results
im writing an article on how to do it right now ill post here when im done...

Resources