Tutorial – Google Analytics

According to your needs, you can use our scripting engine to perform many interesting operations that enhance the look and feel of any website.

Here you will find a short demonstration of our scripting engine’s potential with Google Analytics, a freemium web analytics service offered by Google that tracks and reports website traffic.

If you do not have a Google Analytics account, you can still follow our examples by signing in to your Google account and visiting this link to activate a demo Analytics account.

The first thing that we need to do is to sign in to our Gmail account. This can be easily done with the following commands of our scripting engine. Note: We are using Firefox CSS selectors here.

Webpage: https://accounts.google.com/ServiceLogin

# If the Chromium switch is OFF 
type("""#Email""", """your_email""")
pause(1)
click("""#next""")
pause(1)
type("""#Passwd""", """your_password""")
pause(1)
clickAndWait("""#signIn""")
pause(1)

# If the Chromium switch is ON
pause(2)
type("""#identifierId""" , """your_email""")
pause(1)
click("""#identifierNext""")
pause(2)
type("""#password>div.aCsJod.oJeWuf>div>div.Xb9hP>input""" , """your_password""")
pause(1)
click("""#passwordNext""")
pause(2)

Next, we need to navigate to our demo Analytics account.

openAndWait("""https://analytics.google.com/analytics/web/?utm_source=demoaccount""")

If we want to view an enhanced report, we can click on the view full report link in the bottom right corner and pause until all the web elements have been loaded.

click("""div._GAl""")
pause(20)

If we want to remove everything else except the Audience Overview statistics, we can do the following:

extract(""".R_REPORT_CONTENT""")
pause(5)

To select a per month analysis, we can click the Month field on the upper right.

click("""li._GADd:nth-child(3)""")
pause(5)

Finally, we can navigate our report to the next page by clicking the right arrow on the bottom right. We can add the following commands to repeat this action 5 times at a 10-second interval.

repeat(5){
click("""._GAPW""")
pause(10)
}

For a 1080p display, the optimal zoom factor for our example would be 120%. It is also advisable to enable the Chromium switch for faster rendering.