Documentation forLoggly

Tracking Pixel

Loggly provides the infrastructure to aggregate and normalize log events so they are available to explore interactively, build visualizations, or create threshold-based alerting. In general, any method to send logs from a system or application to an external source can be adapted to send logs to Loggly. The following instructions provide one scenario for sending logs to Loggly.

Tracking pixels are commonly used by web analytics services to track site/application activity. By inserting a 1×1 pixel (.gif) on your web page, HTTP logs can be sent directly to Loggly. Any additional query string parameters can be included, which become the log event.

Our tracking pixel is a great way to track views on particular pages, and to pass data back to Loggly including plain text and JSON. You can send a maximum of 64kb per event. It makes use of an HTTP GET request.

Tracking Pixel Setup

1. Insert Tracking Pixel

Copy the tracking pixel link into your HTML page

<img src="https://logs-01.loggly.com/inputs/TOKEN.gif?message=hello%20world%21&from=hoover"/>

Replace:

2. Send Data

Open the page in your browser to execute the tracking pixel and send data to Loggly.

3. Verify

Verify we received logs with the hello world message within the last 20 minutes. It may take a few minutes to index the event. If it doesn’t work, see the troubleshooting section below.

json.message:"hello world!" 

Tracking Pixel Example

Advanced Tracking Pixel Options

  • HTTP/S Endpoint – for sending single events or multiline events
  • Automated Parsing – we automatically parse many types of logs including JSON and timestamps
  • Tags – you can include tags (Just like HTTP(S) POSTs). For example, to include the tag "pixel" <img src="https://logs-01.loggly.com/inputs/TOKEN/tag/firsttag/secondtag/1*1.gif?key=value1&key2=value2&anotherkey=another%20value" />
  • Nested JSON – you can send nested JSON by URL encoding the data and using the PLAINTEXT parameter. We will still parse the JSON, but it bypasses the key-value extraction step. For example, <img src="https://logs-01.loggly.com/inputs/TOKEN/tag/firsttag/1*1.gif?PLAINTEXT=%7B%22key%22%3A%22value%22%7D" />
  • Encrypt Data – Just switch the URL to https to encrypt the data. The SSL handshake may increase latency.
  • Search or post your own tracking pixel logs question in the community forum.

Troubleshooting Tracking Pixel Logs

If you don’t see any data show up in the verification step, then check for these common problems.

Check Your App:

  • Wait a few minutes in case indexing needs to catch up
  • Make sure you replaced your customer token in the URL
  • If you are trying to use the automatic verify feature, make sure you have the hello world message
  • See our HTTP Event Troubleshooting Guide to verify HTTP events are being sent to Loggly.

Still Not Working?