<commit_before>﻿<%--http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later--%>

<%@ Page Language="C#" %>
<%@ Import Namespace="Piwik.Tracker" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>

This page tracks a goal conversion with the Server Side tracking API and displays the response. <br/><br/>

<% 
    PiwikTracker.URL = ConfigurationSettings.AppSettings["PiwikURL"];

    var piwikTracker = new PiwikTracker(1);
    piwikTracker.enableCookies();

    var attributionInfo = new AttributionInfo();

    attributionInfo.campaignName = "CAMPAIGN NAME";
    attributionInfo.campaignKeyword = "CAMPAIGN KEYWORD";
    attributionInfo.referrerTimestamp = new DateTime(2011, 04, 08, 23, 48, 24);
    attributionInfo.referrerUrl = "http://www.example.org/test/really?q=yes";

    piwikTracker.setAttributionInfo(attributionInfo);
    
    piwikTracker.setCustomVariable(1, "custom-variable1", "custom-variable1-value");

    var response = piwikTracker.doTrackGoal(1, 42.69F);

    this.Response.Write(response.StatusCode);
    var receiveStream = response.GetResponseStream();
    var encode = Encoding.GetEncoding("utf-8");
    // Pipes the stream to a higher level stream reader with the required encoding format. 
    var readStream = new StreamReader(receiveStream, encode);
    this.Response.Write("\r\nResponse stream received.");
    var read = new Char[256];
    // Reads 256 characters at a time.    
    var count = readStream.Read(read, 0, 256);
    this.Response.Write("HTML...\r\n");
    while (count > 0)
    {
        // Dumps the 256 characters on a string and displays the string to the console.
        String str = new String(read, 0, count);
        Response.Write(str);
        count = readStream.Read(read, 0, 256);
    }
    // Releases the resources of the response.
    response.Close();
    // Releases the resources of the Stream.
    readStream.Close();    
%>

<br />

<a href="../Default.aspx">Back</a><commit_msg>fixed run time error (due to api changes) in  ServerSideGoalTracking.aspx that was not catched by compiler<commit_after>﻿<%--http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later--%>

<%@ Page Language="C#" %>
<%@ Import Namespace="Piwik.Tracker" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>

This page tracks a goal conversion with the Server Side tracking API and displays the response. <br/><br/>

<% 
    PiwikTracker.URL = ConfigurationSettings.AppSettings["PiwikURL"];

    var piwikTracker = new PiwikTracker(1);
    piwikTracker.enableCookies();

    var attributionInfo = new AttributionInfo();

    attributionInfo.campaignName = "CAMPAIGN NAME";
    attributionInfo.campaignKeyword = "CAMPAIGN KEYWORD";
    attributionInfo.referrerTimestamp = new DateTime(2011, 04, 08, 23, 48, 24);
    attributionInfo.referrerUrl = "http://www.example.org/test/really?q=yes";

    piwikTracker.setAttributionInfo(attributionInfo);
    
    piwikTracker.setCustomVariable(1, "custom-variable1", "custom-variable1-value");

    var response = piwikTracker.doTrackGoal(1, 42.69F);

    this.Response.Write(response.HttpStatusCode);
%>

<br />

<a href="../Default.aspx">Back</a>
{'fraction_non_alphanumeric': 0.1368785399622404, 'fraction_numerical': 0.022655758338577723, 'mean_word_length': 3.8239757207890746, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5998778', 'n_tokens_mistral': 1079, 'n_tokens_neox': 964, 'n_words': 238}