Sunday, December 6, 2009

Tracking Web hits to PDFs with Google Analytics

Here's some sample code on tracking PDFs, video, image files (anything other than HTML or server-processed pages). This a simple takeover of your own anchor tag that drops a quick client-side event in there for google to track, just before serving up your PDF.


< a href="http://www.example.com/files/map.pdf" onclick="javascript: pageTracker._trackPageview('/downloads/map'); ">

I'm not entirely clear on whether or not the link used in your javascript has to actually exist. If anyone figures it out before I get around to it, please post here!

In the mean time, here's a link to the Google Analytics support page addressing this exact approach.

Saturday, December 5, 2009

Exporting to JPEG in Illustrator AND Preserving your Image Quality

If you struggle with exporting your Illustrator artwork as a print file using your canvas size and original document dimensions and resolution, the answer is fairly simple. As a quick aside, you may get around this problem for web graphics, because using "Save for Web and Devices" automatically uses the canvas size with the "clip to artboard" option under the "image size tab in the "Save for Web and Devices" window. Unfortunately, it also automatically uses low resolution artwork, thus typically shrinking the resolution and quality of your art by 60% (from 300 dpi to 72 dpi).

If only Adobe would include that simple option under"Export" as well, the fix would be intuitive, and I'd be finishing my work right now, instead of writing about it! (Actually it appears this feature was added in CS4, and as of the writing of this article, I am using CS 3).

Even if you have defined your document's size, Illustrator will not, by default, recognize that size upon exporting to JPG (or even COPY+PASTing into Photoshop). To explicitly set the output size of your document, you'll want to create crop marks. I guess the blessing and the curse of Illustrator is that you can set up your canvas size, and then completely ignore those settings and export any area of the canvas you want. For a lot of designers, this makes good sense as we tend to keep color pallets, shapes, drawings or other artwork outside the printable area, but close enough so it's useful while we're creating.

OK, here's how to create cropmarks:

Draw a rectangle that defines a cropping area, and choose:

Object > Cropmarks > Make.

For additional support, check out the link below. It also discusses making trim marks, too:


http://answers.yahoo.com/question/index?qid=20080906032554AArlDD9

"Cropmarks are visible in Illustrator but become invisible when placed into another program (such as QuarkXPress or Adobe PageMaker®) except that they will reappear if you position objects beyond the cropmarks. To remove cropmarks, either choose Object: Cropmarks: Release, or make a new rectangle and again choose Object: Cropmarks: Make."

"Creating “cropmarks,” then “trim marks”
Or create always-visible Trim Marks by selecting any object (a rectangle is not required) and choosing Filter: Create: Trim Marks. Files can contain multiple trim marks."