Google Analytics : How to track image/PDF URL is accessed? - google-analytics

I am sending an marketing Email attaching an image or PDF URL.
Is there is any way to track how may users viewed/clicked this page via google analytics ? I could see the number of page view who accessed html pages but seeking for a way to find how many of them accessed image or PDF URL?

Including a link directly to a pdf or image will simply open the resource without JavaScript tracking or cookies required for Google Analytics.
You would need to send a GA hit from your server in response to the request for those files - neither trivial nor recommended in this case
Rather send the link to a page on your site containing the content.
Tracking that in GA is trivial and is likely already set up on your site.
If you need to have the content in a PDF rather than on the web page directly, have a link to the PDF and track that as an event or Virtual Page View
I would also recommend tagging the link in your email with GA UTM Campaign Parameters to identify the traffic from that link
If your question is about tracking the email itself, please restate the question.

Related

How to create a Google Analytics report on a specific query string?

I have hunted around a bit and only found how to setup the site search parameter in a site's admin section. This is not what I want. Also looked through some Google Search Console videos - no go.
Given a URL, https://somesite.com/redirect/?redirect=https://gofundme.com/somecampaign/.
As some background, what I have setup here is a simple page that says "Loading..." and is used for external links I want to track analytics on, from platforms that I may not have access to the link's analytics. For example: https://gofundme.com/somecampaign.
Rather than having a redirect setup on the page itself, I injected custom JavaScript through Google Tag Manager that records analytics data in Google Universal Analytics (anyone want to recommend how to do this in G4A?) then performs the redirect.
My question is, in Google Analytics, how do I setup a custom report where the query string parameter = redirect and/or the specific page URL?
Thanks.

Can't track in Google Analytics data from GetResponse

Our email marketer is sending email from GetResponse with a tracking code generated from another tool,
but we can't see if the users are coming from the email source.
Is it possible, because it is with tracking code generated from other tool, GA to mark it as direct traffic and is there a way to know it is coming from the email campaign? Also, I am not sure it is tracking it at all, becouse I don't see much traffic in the landing page. The GA is fired, I checked!
The tracking code includes the main domain and it redirects to a specific page.
Example: tracking.ourdomain.com/aff_c?offer_id=46&aff_id=76
You have to check in Landing Pages report (or All pages report), filtering by aff_id, if there are any sessions.
To track in correct mode the source you have to use UTMs parameters. You can build your URL with UTM parameters using this tool. It allows you to easily add campaign parameters to URLs so you can track Custom Campaigns in Google Analytics. Then you can find those sessions in source / medium report.

Tracking UTM paramaters in iframe with own Google Analytics

I'm having issues with tracking the UTM parameters in Google Analytics on an iframe.
My website is embedded in an iframe on http://www.blokker.be/inuwkot and http://www.blokker.be/danstonkot. The visitors go straight to the two links (either dutch or french). No visitors go straight to my own domain.
In the overview page form analytics I can view the amount of visitors/views but not the UTM parameters. I can only see it's a referal.
Any ideas on how to get the UTM url's working in the iframe so I can see where my visitors come from?
Since your frame content is located on a different domain you can not track url parameters from the hosting page without support from the domain owners - they would either have to append the parameters to the frame url, or send a message using the postMessage interface which allows cross-domain communication between pages and embedded frames.
So the page has to send the information to the frame, you cannot simply access it (for security reasons). If the owners of the blokker.be domain do not support that then you are out of luck.

Google analytics in iframe content (different domain)

I have been reading some google documentation on tracking via google analytics, but still hasn't have a clear understanding of what's happening, I will put this in plain english so that my query can help others as well.
Basically I have 2 sites: siteA.com (parent), and siteB.com (child)
I have created a widget on siteB.com, i.e. siteB.com/widget. Let's say in this case I embed siteB.com/widget on siteA.com (home page)
<iframe src="http://siteB.com/widget"></iframe>
And on siteB.com, I have the relevant google analytics installed. So my question is:
Will siteB.com google analytics be able to register siteA traffic? (one traffic to siteA.com equals to siteB.com/widget.)
Many thanks!
Short Answer : No, It is not as simple
For cross browser tracking:
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite?csw=1#trackingIFrames
In a site where the transfer between domains is done by opening a new
window or by including content in an iFrame, you will need to to
use the _getLinkerUrl() method to transfer visitor and campaign
cookies from one domain to another. For example, suppose you include a
form in an iFrame that is hosted on www.my-example-iframecontent.com.
In order to transfer visitor information from the parent page that
hosts the iFrame on www.example-parent.com, you would use JavaScript
to load the iFrame and pass in the cookie information using the
_getLinkerURL() method.
There are different ways to setup and it all depends on your configuration. Therefore, I suggest that you setup some test profile and experiment with your settings.

Techniques to Trigger Google Analytics Tracking from PDF Links

Here's the scenario:
I have a mailing list that contains a PDF download link. The PDF contains ads with clickable links. I need to get analytic data on the link clicks - preferably via Google Analytics (due to the richness of information available).
The solution I have in mind is for the link to go to a web page that I host with some sort of ad-specific token. GA records the request and then I use a client-side technique to redirect to the actual target URL. The redirect page serves no purpose other than to track the click and so I'm not worried about it being perceived as cloaking by search engines.
What I want to know is:
Are there any alternative ways to achieve the tracking without using an intermediate redirect page (could I perhaps call GA server-side somehow)?
If I do use the redirect page approach, what are potential pitfalls could I encounter?
Thanks in advance for any advice.
dunno what server-side environment/language you use but for instance in php you can use cURL to send an image request to google, with the custom code appended to the url. Easiest way to do it is to output the code with javascript with your custom code and then capture the image request url with a sniffer, so you can replicate the format for your cURL request. Make sure to send header info, including fake browser info so GA doesn't weed it out as a bot. Then forward to the ad url. That way you don't need to output a page.
Yeah you still have a 'redirect' happening but you cut out having to have the client download a page or worry about javascript being disabled, etc...
unfortunately there really isn't anything better you can do.

Resources