google analytics and page_load

Posted on 2008-11-12
Last Modified: 2013-12-17
I have a client with a website that we have added the google Analystics script to it.  He has a few pages that have links for pdf files.  So what I did was I have the page with the links (page1) calling a 'secondary' page (page1a) that has the google script on it so that we can track the user wanting to download the pdf.  So the logic is:
1) show page1 with pdf links.  
2) user clicks on pdf link #1 - goes to pdf#1link.aspx page...which in the page_load event has 'Response.redirect("1pdf").  in the html of pdf#1link.aspx page contains the google script.
3) user gets the pdf document

What I am wondering is if the script on the pdf#1link.aspx page will run BEFORE the page_load response.redirect("1.pdf") code will run...if not, under what event should I put the redirect?
Question by:cenetadmin
    1 Comment
    LVL 15

    Accepted Solution

    try to inject the javascript for redirection in the form load using Page.RegisterStartupScript


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now