Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 332495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:52:20+00:00 2026-05-12T09:52:20+00:00

I figured out how to create a bookmarklet for Google Analytics that opened to

  • 0

I figured out how to create a bookmarklet for Google Analytics that opened to immediately show only today’s stats. I wanted to make a Google Chrome application shortcut for this to go along side my other Google Apps shortcuts, but the first problem is that it only creates an application with the current url, which displays today’s info and of course will display yesterday’s info tomorrow. I figured I’d edit the target to the shortcut and replace the url with the javascript I had. The second problem is the line of script is too long. Window’s shortcuts target paths can only hold 290 characters or something like that. The path to Chrome as well as the script went past that.

What are my options at this point? I’ve scoured the web and wasted way too much time for such a small piece of my life, but I’d like to figure it out.

I know jimmy-squat about programming. I can sort of edit javascript, but not really write it. I used the YUI Compressor to try and shrink it down, but it didn’t change much. I also tried using a url shortener, but they all add the http:// prefix and that screwed it all up. I read I could point to a bat file in the shortcut target, but couldn’t figure out how to do that either… plus I figured there was an easier way to do this that didn’t require any minor hacking, which I’d like to avoid.

I was easily able to bookmark the site in Chrome and replace the url with the javascript and it works fine, and that was half my goal. But I really would like to have this as a Windows shortcut and behave in the exact same way the other apps work because they remember the previous window size.

Any suggestions on an easy solution?

Here’s the bookmarklet’s script –

javascript:var d=new Date();if(d.getMonth()<10){var pad='0';};var t=''+d.getFullYear()+(pad+(d.getMonth()+1))+d.getDate();location.href='https://www.google.com/analytics/reporting/dashboard?id=HIDDENID&pdr='+t+'-'+t+'&cmp=average'

Also here’s the path to different but pretty similar application shortcut from Chrome –

"C:\Documents and Settings\USERPROFILE\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --app=http://docs.google.com/a/MYGOOGLEAPPSDOMAIN/
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:52:20+00:00Added an answer on May 12, 2026 at 9:52 am

    Why not create a local .html file containing this:

    <script type="text/javascript">
      var d=new Date();
      if(d.getMonth()<10){
       var pad='0';
      }
      var t=''+d.getFullYear()+(pad+(d.getMonth()+1))+d.getDate();  
      location.href='https://www.google.com/analytics/reporting/dashboard?id=HIDDENID&pdr='+t+'-'+t+'&cmp=average'
    </script>
    

    Then you can just use that as your “shortcut”.

    The %AppData% may help you get a few more characters out of the shortcut as well. If running chrome.exe from the command line is resulting in a different type of window being opened than double clicking the HTML file, you may need to point chrome.exe at the workaround.html

    %AppData%\Google\Chrome\Application\chrome.exe --app=file:///c/googleworkaround.html
    

    Also, manually compressing some of your logic a bit resulted in this 268 character code golf which may or may not work for you.

    %AppData%\Google\Chrome\Application\chrome.exe --app=javascript:var d=new Date(),t=[d.getFullYear(),d.getMonth()<9?'0':'',d.getMonth()+1,d.getDate()].join('');location.href='https://www.google.com/analytics/reporting/dashboard?id=HIDDENID&pdr='+t+'-'+t+'&cmp=average';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 209k
  • Answers 209k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I am not sure but is it Microsoft Research? May 12, 2026 at 9:44 pm
  • Editorial Team
    Editorial Team added an answer char[] is your datatype. "char" is a single 16 bit… May 12, 2026 at 9:44 pm
  • Editorial Team
    Editorial Team added an answer A folder off the AppData folder - use SHGetFolderPath() and… May 12, 2026 at 9:44 pm

Related Questions

So I've been pondering this for some time and trying out various strategies. Basically
I figured out how to create a static method that is available everywhere, for
I'm trying to create a program that reads a .docx file and posts it
I am trying to create a utility keystroke app so i can do things

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.