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
- TOKEN: your customer token from the source setup page
2. Send Data
Open the page in your browser to execute the tracking pixel and send data to Loggly.
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.
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.
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?
- Search or post your own tracking pixel question in the community forum.
When the APM Integrated Experience is enabled, Loggly shares a common navigation and settings with the other integrated experiences' products. How you navigate Loggly and access its features may vary from these instructions. For more information, go to the APM Integrated Experience documentation.