Google Analytics (need help to application) event tracking

Hi all.

I'm trying to implement Google Analytics tracking events on the 3 images downloadable click in my Flex application.

I did some research on the web, and it seems there are different ways to do? But every tutorial I've seen missing a piece, and now that I have seen so many different approaches, I am completely confused.

Here is where I am at this time.

I followed this tutorial here...

http://code.Google.com/APIs/Analytics/docs/tracking/flashTrackingSetupFlex.html

And downloaded the library followed and properly installed the component in Flex.

Then I scrolled past to the MXML implementation, to the implementation of AS3.

I added 2 imports (import com.google.analytics.GATracker;)

import com.google.analytics.AnalyticsTracker ;)

Public var (var public tracker: AnalyticsTracker ;))

And the two functions (private function onComplete (): void {})

Tracker = new GATracker (this, 'AU-111-222', 'AS3', false);

}

public function onButtonClick (): void {}

tracker.trackPageview (' / Hello/world ");

}

These are copied and pasted from the sample code provided by this link.

The goal:

Is to follow the download of the images click on.

My questions are...

Should what settings I change to make it work for my application?

Also, do I need a separate function for each click image that I followed or can I reuse the same function?

Here is my code.

<? XML version = "1.0" encoding = "utf-8"? >

" < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute" "

width = "760".

height = "760".

backgroundImage = "twitterSkins - background.jpg."

backgroundColor = "#202020."

horizontalAlign = "center".

verticalAlign = "top" >

< mx:Script >

     <! [CDATA]

import mx.core.IUIComponent;

mx.effects import. *;

flash.net import. *;

import com.google.analytics.GATracker;

import com.google.analytics.AnalyticsTracker;

private var request1:URLRequest = new URLRequest ("http://www.theawesomemovie.com/images/twitter_skins/Twitter_Skin1.jpg");

private var fileRef1:FileReference = new FileReference();

private var request2:URLRequest = new URLRequest ("http://www.theawesomemovie.com/images/twitter_skins/Twitter_Skin2.jpg");

private var fileRef2:FileReference = new FileReference();

private var request3:URLRequest = new URLRequest ("http://www.theawesomemovie.com/images/twitter_skins/Twitter_Skin3.jpg");

private var fileRef3:FileReference = new FileReference();

public var tracker: AnalyticsTracker;

private function onComplete (): void

{

Tracker = new GATracker (this, 'AU-111-222', 'AS3', false); / / <-what settings should I insert here?

}

public function onButtonClick (): void / / <-do I need a separate for each click action function to download image?

{

tracker.trackPageview (' / Hello/world "); / / <-what is happening in these brackets? I guess this is what is sent to the AG as a track number. That's why I wonder if I need a separate for each click function to download image...

}

     ]]>

< / mx:Script >

< mx:Glow id = "mouseOverGlow".

duration = "450".

alphaFrom = alphaTo "1.0" = "0.6".

blurXFrom = "0,0" blurXTo = "25,0".

blurYFrom = "0,0" blurYTo = "25,0".

color = "0xffffff".

KB = "false" / >

< mx:Glow id = "mouseOutGlow".

duration = "450".

alphaFrom = "0.6" alphaTo = "1.0".

blurXFrom = blurXTo "25.0" = "0.0".

blurYFrom = blurYTo "25.0" = "0.0".

color = "0xffffff".

KB = "false" / >

< mx:HBox = horizontalCenter '259' = '0 '.

backgroundImage = "box - gradient.png" width = "711" height = "187" paddingLeft = paddingTop = "22" "57" horizontalGap = "30" >

< mx:Image / / <-code of any need to go to these components of the Image? I guess a call to the functions defined above in the right 'click' action?

               id="skin1"

source = "skin1.jpg"

rollOverEffect = rollOutEffect "{mouseOverGlow}" = "{mouseOutGlow}".

Click = "fileRef1.download (request1, 'skin1.jpg')" / > "

< mx:Image

               id="skin2"

source = "skin2.jpg"

rollOverEffect = rollOutEffect "{mouseOverGlow}" = "{mouseOutGlow}".

Click = "fileRef2.download (request2, 'skin2.jpg')" / > "

< mx:Image

               id="skin3"

source = "skin3.jpg"

rollOverEffect = rollOutEffect "{mouseOverGlow}" = "{mouseOutGlow}".

Click = "fileRef3.download (presente3, 'skin3.jpg')" / > "

< / mx:HBox >

< / mx:Application >

Thank you everyone, I'm still very new to the Flex AS3 as Google analytics platform.

Any idea is appreciated.

DIA

First of all, I don't see no analytic call to one of your functions, they are there but never called.
In any case here a few lines on how to implement google analytic:

Tracker = new GATracker (this, 'AU-111-222', 'AS3', false); // <------ what="" parameters="" should="" i="" insert="">

You just need to insert the tracking code from your website you receive from google.com/analytics

public function onButtonClick (): void / / <----- do="" i="" need="" a="" separate="" function="" for="" each="" image="" download="" click="">

No you don't need every time, just once

{

tracker.trackPageview (' / Hello/world "); // <----- what="" goes="" between="" these="" parenthesis?="" i'm="" guessing="" this="" is="" what="" is="" sent="" to="" ga="" as="" a="" track="" count.="" so="" that="" is="" why="" i'm="" wondering="" if="" i="" need="" a="" separate="" function="" for="" each="" image="" download="">

What you want, it's what happens to appear on the report

}

//<----- any="" code="" need="" to="" go="" in="" these="" image="" components?="" i'm="" guessing="" a="" call="" to="" the="" functions="" defined="" above="" in="" the="" "click"="" action="">

No, you don't need anything here,

And finally, this is how you should implement it:

http://www.Adobe.com/2006/mxml"layout ="absolute ".

width = "760".

height = "760".

backgroundImage = "twitterSkins - background.jpg."

backgroundColor = "#202020."

horizontalAlign = "center".

verticalAlign = "top".

applicationComplete = "init" >

Import mx.core.IUIComponent;

Mx.effects import. *;

flash.net import. *;

import com.google.analytics.GATracker;

import com.google.analytics.AnalyticsTracker;

private var request1:URLRequest = new URLRequest ("http://www.theawesomemovie.com/images/twitter_skins/Twitter_Skin1.jpg");

private var fileRef_1:FileReference = new FileReference();

private var request2:URLRequest = new URLRequest ("http://www.theawesomemovie.com/images/twitter_skins/Twitter_Skin2.jpg");

private var fileRef_2:FileReference = new FileReference();

private var request3:URLRequest = new URLRequest ("http://www.theawesomemovie.com/images/twitter_skins/Twitter_Skin3.jpg");

private var fileRef_3:FileReference = new FileReference();

public var tracker: AnalyticsTracker;

private function init (): void

{

Tracker = new GATracker (this, 'AU-111-222', 'AS3', false);

}

public function onButtonClick (): void

{

tracker.trackPageview (' / Hello/world ");

}

]]>

duration = "450".

alphaFrom = "1.0" alphaTo = "0.6".

blurXFrom = "0,0" blurXTo = "25,0".

blurYFrom = "0,0" blurYTo = "25,0".

Color = "0xffffff".

Knockout = "false" / >

duration = "450".

alphaFrom = "0.6" alphaTo = "1.0".

blurXFrom = "25,0" blurXTo = "0.0".

blurYFrom = "25,0" blurYTo = "0.0".

Color = "0xffffff".

Knockout = "false" / >

backgroundImage = "box - gradient.png" width = "711" height = "187" paddingLeft = paddingTop = "22" "57" horizontalGap = "30" >

<>

ID = "skin1.

source = "skin1.jpg".

rollOverEffect = rollOutEffect "{mouseOverGlow}" = "{mouseOutGlow}".

Click ="" / >

<>

ID = "skin 2.

source = "skin2.jpg".

rollOverEffect = rollOutEffect "{mouseOverGlow}" = "{mouseOutGlow}".

Click = "fileRef2.Download (request2, 'skin2.jpg')" / > "

<>

ID = "skin3.

source = "skin3.jpg".

rollOverEffect = rollOutEffect "{mouseOverGlow}" = "{mouseOutGlow}".

Click = "fileRef3.Download (presente3, 'skin3.jpg')" / > "

Your MX:IMAGE need to be rewritten as currently you never call the function onButtonClick, currently you only call the each instance of filereference upload method. Below is an example that would work (from the top of my head, NOT yet tested)

public void onButtonClick(e:MouseEvent):void

{

Switch (e.currentTarget.ID)

{

case skin ' 1 ':

tracker.trackPageview (' / Hello/world ");

break;

case "skin": 2

tracker.trackPageview (' / Hello/world2 ");

break;

case "skin3":

tracker.trackPageview (' / Hello/world.3 ");

break;

}

}

Tags: Flex

Similar Questions

  • Need help with the launching track pack for forza code 4

    Bought new Forza 4 and the lancer Track Pack code does not work, how do I get a code that is generated in the form I've already paid for it. Rank of loads of numbers and sent 10 s of emails but cant seem to get help.

    This is the help I get when the cat to an Ambassador xbox on xbox.com

    Terry wrote:
    Need help with the launching track pack for forza code 4
    The Xbox Ambassador says:
    Location of Ambassador of the community...
    The Xbox Ambassador says:
    Location of Ambassador of the community...
    The Xbox Ambassador says:
    Your question will be answered by an Ambassador of the Xbox. You have been connected to the Ambassador as a user Xbox [3]
    The Xbox Ambassador says:
    Hello
    Terry wrote:
    Hello
    The Xbox Ambassador says:
    Hey
    Terry wrote:
    just to be on the phone to xbox live support and was told to come here
    The Xbox Ambassador says:
    ok\
    The Xbox Ambassador says:
    What is your problem?
    Terry wrote:
    I bought the 4 for forza ansd 360 new sealed Christmas...
    Terry wrote:
    has got 2 codes that accompanies the game but the pack track code does not work
    The Xbox Ambassador says:
    Wow good
    Terry wrote:
    whenever I put in the code it says code redeemed
    The Xbox Ambassador says:
    I think the code is used. You must return to the retailer
    Terry wrote:
    I tried to, but since I already opened the case they will not accept
    The Xbox Ambassador says:
    Oh. No,
    Terry wrote:
    the code had been used or defective as I am the only person who has touched the game once opened, tried to enter the code when it is open
    The Xbox Ambassador says:
    Maybe it was auto bought?
    Terry wrote:
    so, how do I get another code generated track Pack if defective?
    The Xbox Ambassador says:
    I do not know.
    Terry wrote:
    bought the game new, so I get the track pack
    The Xbox Ambassador says:
    Oh. It's bad.
    The Xbox Ambassador says:
    I think that if you Exchange 1 code it will buy it
    Terry wrote:
    car pack code worked, starter pack did not work
    The Xbox Ambassador says:
    Oh.
    The Xbox Ambassador says:
    It's a bad
    The Xbox Ambassador says:
    BTW you have an evolution of the tests?
    Terry wrote:
    Yes, I want to? but more anxious to get a code object generated for this pack
    The Xbox Ambassador says:
    Hey if I help can u give me this game too?
    Terry wrote:
    ?????????????????
    Terry wrote:
    So is it possible to get a code for that time?
    The Xbox Ambassador says:
    Hey
    The Xbox Ambassador says:
    Yes.
    The Xbox Ambassador says:
    you need to contact them
    The Xbox Ambassador says:
    and tell them that the code is used.
    Terry wrote:
    I was told to come here? where can I go to get the code?

    Hi Terryg76,

    ·         What version of the operating system is installed on the computer?

    I suggest you to contact the game manufacturer for more help and information.

  • HP 15 t select - need help in the event of opening

    I just got an Envy 15 t custom selection and delivered to me in order to upgrade for one SSD HARD drive I have. When I received it, we suddenly see that there is no access at the bottom of the laptop panell, nor it did not seem that the bottom of the laptop could be deleted. Look, the only seam in the whole of the device is where the top plate (which the keyboard is mounted on) responds to the lower part of the body. It's hard to describe, but essentially, it looks like that with this model the keyboard must be free from wall first to access the Interior.

    I tried to find a manual online and I found just for mobile phones of the previous generation where all the background can be "pryed" after the screws are removed. Mine is not like that. I don't know if this is a new generation or what, but there is absolutely no way to get down out of the computer. I tried to get a manual by HP help-chat, but after 40 minutes of waiting and slow responses, the "technician" was able to tell me that the ram and ssd are not extensible in my model because it is a "sleekbook". Of course, this statement is false, but I'm sure that HP does not want people who do not know what they are doing to open the computer.

    I just need to know how to get the machine open without breaking the plastic clips or folding of the upper plate. I got it 70% retired, he just does not know how to get the part directly under the screen on. The one with the most recent repair or some experience with this would eb greatly appreciaed.

    Thanks in advance.

    TheMad.

    Step by step video here.

    http://support.HP.com/us-en/document/c04330942

    REO

  • Need help with the events of user base in state machine example in queue

    I wrote a small example queue state machine to try to teach myself about the creation and use of the user events.  The purpose of the machine is periodically pick a number (I do now with a control instead of a generator of random numbers for troubleshooting), and compare this figure with the number I put in a control.  When they match, I want to raise an event to fire so I can do something about having found a match.  The examples in the file LV references help show events within the structure of the event, but I want to reach out of a State and trigger an event...

    Can someone point me in the right direction here?

    Thank you

    Hummer1

    I think the service you're looking for is generating the user event.  What to put in your consumer loop, inside the case structure when identical numbers.

  • Need help: COM + a event system detected a bad return during its internal processing code. HRESULT has c 8007043 line 45 of d:\longhorn\com\complus\src\events\tier1\eventsystemobj.cpp.

    Hello

    My PC crashes after KB977165 has been installed. Operating system is Windows Vista Premium and restoration was not available after this update.

    Here is the error in the event viewer.

    Internal system of events from COM + has detected what a bad code back during his treatment.  HRESULT has c 8007043 line 45 of d:\longhorn\com\complus\src\events\tier1\eventsystemobj.cpp.  Contact the Services de Support technique Microsoft to report this error.

    Help is greatly appreciated. Thank you.

    Hi Chennelyn,

    First of all, try to uninstall the update manually and check if the problem persists.
    http://Windows.Microsoft.com/en-us/Windows-Vista/remove-an-update

    http://support.Microsoft.com/kb/925809

    Then, switch your computer to boot in order to check if the problem persists. A clean boot helps eliminate software conflicts.  Let us check if software is causing the problem by following the clean boot procedure.  To perform the clean boot procedure, follow the instructions in the link below.

    Step 1: Perform a clean boot
    Step 2: Enable half the services
    Step 3: Determine whether the problem returns
    Step 4: Enable half of the startup items
    Step 5: Determine whether the problem returns
    Step 6: Resolve the problem
    Step 7: Reset the computer to start as usual

    How to troubleshoot a problem by performing a clean boot in Windows Vista
    http://support.Microsoft.com/kb/929135

    After checking the problem, turn the computer back to the Normal mode. Uninstall or update the program that is causing the problem.

    Previous post: the result.

    Bindu S - Microsoft Support

    [If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.]

  • Google Analytics - yet another problem with the tracking code

    My site is: Codyiddings.com

    I put the Script needed both in the "Page Properties" and a random HTML Widget as well. If you look at the source, it's here.

    But I get this message within the GA:

    Status: Tracking not installed

    Last review: November 8, 2015 8:34:59 AM PST


    I use BusinessCatalyst to host my Web site and I have codyiddings.com as the default URL and the URL associated with GA.


    Any ideas?

    There may be several reasons as domain not verified, please check if all controls are carried out with GA for the domain that you added to your site.

    Thank you

    Sanjit

  • Need help with application of a gradient for a displacement map.

    http://img31.imageshack.us/img31/5046/hexagonex2.jpg

    How a gradient of mitigation can be applied to this Hexagon,

    to make it darker to the outer edge

    and inner edge, everything also.

    I'm hoping to use it as a displacement map,

    While it will be a 3d which exceed the hegagon

    which is smoothed to the surface using the gradient.

    I appreciate all help.

    Make a hexagonal shape. In the layers panel at the top, set "Fill" at 0%.

    Add a layer to shot Style; the value of the gradient fill Type and style to the Position of the Burst.Set shape to the inside, so the corners remain strong, not rounded. You will also need a black-white-black gradient.

    Gives:

  • Need help with Application APEX

    Hi all

    I am very new to the APEX and have searched high and low for answering the following question. I hope that some people here can point me in the right direction or explain how to accomplish the following:

    I have an application which is supposed to follow the service call out.

    I have the following columns defined:

    The size of the column name Datatype

    IDENTIFICATION NUMBER-
    DISP_ID VARCHAR2 30
    NUMBER OF ZONE-
    NUMBER OF THE WR-
    ADDRESS VARCHAR2 30
    CITY VARCHAR2 30
    DATE OF TIME_RECD-
    DATE OF TIME_DSP-
    TECH_ID VARCHAR2 30
    VARCHAR2 '15' 10
    ARRIVAL DATE-
    VARCHAR2 '45' 10
    DATE OF ELAP_TIME-
    NUMBER OF AVAIL-
    RELATED_WR VARCHAR2 30
    REASON_45 VARCHAR2 255
    DATE OF EOL_DATE-

    What I want to happen is the following:

    When a user enters 'TIME_RECD' and TIME_DSP' I want the app automatically calculate the amount of time that has elapsed and displays the amount in the column '15', if it is higher at 15 min. (TIME_DSP - TIME_RECD = '15' only if it's 15 or higher)

    Also

    When a user enters "ARRIVAL" I want the app automatically calculate the amount of time that has elapsed and displays the amount in the column "45" if it exceeds 45 min. (- TIME_RECD = '45' only if it is 45 or more)

    I'm also not sure where these calculations should be placed in the app... I'm guessing on the entry form, but really have no idea.

    If you would like more information please let me know.

    Thanks in advance for any help you can provide.

    Lowell,

    No worries - we all started somewhere.

    If you try to change the date format of the columns in a report of the ApEx, go into the details of the report and click on the Edit button to the left of the name column. In the ' Number/Date Format' field enter: HH

    Kind regards
    Dan

    http://danielmcghan.us
    http://sourceforge.NET/projects/tapigen
    http://sourceforge.NET/projects/plrecur

  • Need help with user events

    I have an initialize VI where I create a number of user events.  Originally, these consisting of a number of different types of data and have been released as a cluster.  However, I had to change this to an array of variant, as I'm indexing later user refnums in a loop FOR to generate a Boolean matrix of the conditions-based events.  As I'm unable to elements of a cluster index, I have all types of event data changed to variants so that I could pass them on in a table that could be indexed.  It seems, however, that the labels property that populate the structure of the event with the names of the individual event to select from are lost during the use of variants - the structure of the event shows that multiple instances of

    : User event

    in the drop-down list.  Is it possible to get the event names to persist or pass them in the structure of the event, so I can configure cases properly?

    It seems so the VI changed with the data types variant event works, but for some reason, the structure of the event did not update to reflect the changes.  After removing and recreating the event record Refnum indicator in my VI initialization and recharge the parent VI, everything seems to work as expected.

  • Need help from application own focus background

    Hi guys

    I used an array of tree to display my data. From there, I have a PNG icon and two text labels, one is white, the other is gray.

    Sounds good as long as the background is black. but since I want to show the user the update, I put the background to focus on the table to blue view:

    tableView.setDataTemplateFocus (BackgroundFactory.createSolidBackground (0x098bff));

    It looks like:

    In addition, the focus moves from one line to the other. the only problem is that the gray text label is unreadable.

    to resolve this problem, I created a clean background:

    Bottom b = new Background() {}

    public Boolean isTransparent() {return false;}

    public Sub {draw (Graphics g, XYRect rect)

    g.setColor (0x098bff);

    g.setDrawingStyle (Graphics.DRAWSTYLE_FOCUS, true);

    g.fillRect (0, 0, rect.width, rect.height);

    }

    };

    tableView.setDataTemplateFocus (b);

    This works almost! now, the text becomes white perfect!

    BUT: when I move put point of one line to the other, blue background does not move, it remains on top.

    How to solve this problem? Background drawing style setting to false after completing the rect blue doesn't help either.

    Thank you

    Please use this line to mathod draw().

    g.fillRect (0, getSelectedIndex () * rect.height, rect.width, rect.height);

  • 10 COLDFUSION is not accessible to IE using HTTPS, but accessible to FireFox/Google Chrome - need help ASAP

    Hi all

    I have a weird problem with the CF10. I have configured Tomcat 7 and configure SSL. Manager Tomcat works fine for HTTP and HTTPS for IE and Chrome. I created the WAR for the CF10 and deployed on Tomcat 7. CF10 admin can be access via http in IE and Chrome. But the HTTPS protocol is not access via IE (any version) but accessible via Chrome. Even my manager Tomcat stop work over HTTPS for IE but its fine in Chrome or firefax work. Anyone know the configuration I need to change? Do you know the reason why I have this problem of weerd?

    It seems the BUG is that using Java 1.6. After some tests, the investigation, we found that the use of Java 1.7 will address the issue. Although we do not know the root cause

  • Need help, download applications Manager

    Download of Adobe Application Manager, error 503 error. Try again option but failed all three times.

    Read a similar thread in forum http://forums.adobe.com/message/4709096?tstart=0

    Can you check after some time and repost if you still having the problem. Could be a temporary problem.

    Thank you

    Preran

  • Need help: resizing a video track together

    Hello everyone

    To begin, forgive my poor English syntaxis

    Recently, I filmed a concert with several cameras, Gopro (at 1280 x 960) and a 7 d (1920 x 1080).

    Now, I want to change it all in first, with a final format of 1280 x 720. I have pieces of film gopro and pieces of film 7 d.

    What I want to do, is to have, for example, a track of Gopro with my gopro bits and a track of 7 d with every bit of my 7 d. My gopro pieces fit perfectly in the layout, since they have the right width (it cultures the height, but that's what I want), but the 7 d clips are too big (1920 x 1080 instead of 1280 x 720). I could resize each of my clips in properties, but because they are far too many of them, I want to evolve on the 7 d set track. Is it possible to do?

    Thank you!

    Ricardo.

    Change than a single sequence and everywhere where one is a 7 d clip... . Select scale to the size of the image or use the scale of movement.

    Your & D staples and clips of Gopro will be seen in the source monitor properly scaling (natively) but when in the monitor of the program... not the case.  That's why "scale to the size of the image or the other option.

  • How to add Google Analytics event tracking to a pdf download or play the video by Muse code

    I want to be able to use a test of Athletics of Google Analytics code to track downloads of documents PDF and video plays on my Muse built Web site. It seems that the code must be added to each object, rather than in the header where lives the mode page GA tracking code. Is there a solution or how to use the tracking code in the header? Thank you!

    Hi Gary,.

    You must Access the source link code to do so. You can then add the event tracking code to each PDF you want to track.

    A handy tool to generate the event tracking code can be found here.

    If you do not have access to the HTML body, you can try using Google tag Manager , although it is a little more complicated!

    Hope that helps.

  • Need help, trying to decipher my Panel event logs control for security and applications.

    Hi, I need help trying to figure out how to decipher my control panel the security event logs and logs application for account hacking.

    All the advice to learn how to see what who are normal and what is malicious?

    Occurrences of breach possible system, based on very high traffic for the opening of session and closing session and special privilege settings.

    Please notify.

    HP Pavilion DV9700 entertainment

    Windows Vista SP1 Home Premium 32

    I'll leave this thread closed, since I work with other people on another forum on this topic.

Maybe you are looking for