spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

Posting metric to google analytics from perl script


I am able to post analytics from my php scripts, but could not post analytics from perl script.

I solved my problem as follows. Created an utility php script and called that php script from my perl script. Then it worked.

<?php 
    $ec = $_GET['ec'];
    $ea = $_GET['ea'];
    $el = $_GET['el'];
    $ev = $_GET['ev'];

    // Send event tracking as well.
    $url =
'http://www.google-analytics.com/collect';
    $event_data = array(
            'v' => '1', 
            'tid' => 'UA-XXXXXX-Y', 
            'cid' => $_SERVER["REMOTE_ADDR"], 
            't' => 'event', 
            'ec' => $ec,
            'ea' => $ea,
            'el' => $el,
            'ev' => $ev);
    $event_options = array(
            'http' => array(
                'header'  => "Content-type:
application/x-www-form-urlencoded
",
                'method'  => 'POST',
                'content' =>
http_build_query($event_data),
            ),
        );
    $event_context  =
stream_context_create($event_options);
    $result = file_get_contents($url, false,
$event_context);

    echo "XXX";
?>

Categories : Perl

Related to : Posting metric to google analytics from perl script
Google Mobile Analytics Event Tracking: Multiple properties to describe an event in google analytics
You can't store date from arbitrary JavaScript objects with Google Analytics events. Each event is limited to 4 properties: category, action, label and value. So it is possible to describe an event with multiple properties, but it's very constrained.

Categories : Misc
Action Script 3 - Posting a JSON to a RESTful server
If you're content type is application/json, then you don't want to use URLVariables for your data: //this is causing the problem because it's encoding your JSON string so it's url safe. var vars: URLVariables = new URLVariables(); vars.data = JSON.stringify(messages); Instead, assign the stringified JSON directly to the URLRequest's data property like in the following example: var urlRequest

Categories : Ajax
How do I add Google Analytics to a Meteor app?
There is a package available meteor add datariot:ganalytics that adds GA to Meteor. It allows the user to configure analytics and set GA events. Found here: https://github.com/datariot/meteor-ganalytics

Categories : Javascript
Google analytics userID tracking
No. The user id feature is intended to recognize authenticated users across devices so it can generate cross-device reports. However Analytics will still deliver aggregated data only. If you create ids to recognize individual users you not only need to be careful not to violate Googles TOS (which forbid to user personal data or anything that can be used for people outside your company to identif

Categories : Javascript
Google Analytics Goals Regex
I do not understand your use case. If somebody calls the goal destination the goal is completed, so it is not possible to have the destination as a goal step in the first place. So there would be no point in excluding the destination url from the funnel (which, as pointed out in the comment, is not possible in any case). And frankly, funnel Visualisation sucks - skipped steps get backfilled, rep

Categories : Regex
Recently Add
SSL error calling Perl web service via https using LWP
SOAP::Lite always faults in debug mode
perl referencing a hash outside of the scope that populated it (histogram)
Perl script to print out all the lines containing a keyword and the line below it
PERL Unicode Escape string pass from command line argument wrong output
Perl process crashes after handling signal
Marpa: Can I explicitly disallow keywords as identifiers?
Perl: Import text, containing ÅÄÖ, from file
error using perl - Proc::ProcessTable. works in cmd line, not in .pl file
DBIx::Class chaining resultsets with same table in prefetch
Time as input, print timetable in Perl
compare values of different tables perl
Automatically increasing ID generation using PERL
Syntax Error, first line after dostuff
Delete files in a folder using Perl
Perl '-d' operator is not detecting a directory
Perl appending text to new line
write_timeout in IO::Socket::Timeout
Using ForkManager and Perl properly?
Is a cyclic dependency solved with require?
Posting metric to google analytics from perl script
How can I check if a user enters my page the first time?
Sorting arrays of intervals in perl?
Perl: How to get the link target of a soundcloud feed mp3
Uninitialized value in concatenation
Perl code - pipe "|" in `open()` statement
perl command line backticks with matrix
Perl OO - Creating a list of objects
extract gene-id + function annotation from .gff
How to receive parameters and values from POST method in Perl CGI?
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.