Stage Pixel Implementation¶
To allow us to track users through the funnel stages, and to allow us to optimise spend on true performance, we require all clients to implement our tracking pixel.
If you are using our landing pages, this is taken care of for you, so nothing is needed on your part.
If you are however implementing your own landing pages, you will need your tech team to implement our pixels as described and to provide access to your complete pages in order for us to verify your implementation.
Technology¶
We do not enforce any specific tools, frameworks or coding languages, our tracking pixel is a very simple URL that you need to make sure is populated and called at various critical points.
Our UID¶
Our UID is a unique numeric string that is generated for each and every ad click. It is an important part of our tracking pixel and is the core element that enables all of our unique reporting and optimisation capabilities.
When a user clicks on an ad, we generate this UID and pass it the designated landing page as a query string parameter. This will have the default name uid
. For example, a user clicks an ad, and is redirected to:
https://example.com/landing-page?uid=1234
This UID is important for your stage pixel implementation because you must take the UID from the URL and place it into the URL of the tracking pixel.
Implementation¶
The tracking pixel can be called in a number of ways; you could load it directly on page in an img
tag via a server-side script, or you could call it directly via JavaScript. Whichever method you choose, that works in your particular technology set up, we simply require that you make sure the call takes place reliably and that we can verify it our end.
The tracking pixel/url looks like this: https://api.leandigitalmedia.com/v1/sp/ts/{__UID__}/1
where {__UID__}
is the placeholder that needs replacing with the uid from the current pages URL before calling.
So in the example above, the complete URL would be: https://api.leandigitalmedia.com/v1/sp/ts/1234/1
Also notice the /1
part at the end, this represents "Stage 1", or a user landing on your your page.
We also require you to call /2
(https://api.leandigitalmedia.com/v1/sp/ts/{__UID__}/2
) which represents a form fill, so should be implemented on your thank you page after a user has successfully completed a form submission. Note, it is down to you to pass the UID through your form as needed, or if your form is AJAX based, you can use the same query string parameter.
Example implementation (JavaScript)¶
Below is an example implementation you could place in the header of your landing page inside script tags:
var __ldm_rgx = new RegExp('[\\?&]uid=([^&#]*)')
var __ldm_uid = __ldm_rgx.exec(location.search)
if (__ldm_uid && __ldm_uid[1]) {
var __ldm_img = document.createElement('img')
__ldm_img.width = 0
__ldm_img.height = 0
__ldm_img.src =
'https://api.leandigitalmedia.com/v1/sp/ts/' + __ldm_uid[1] + '/1'
document.body.insertBefore(__ldm_img, document.body.firstChild)
}
This script first checks that the UID query parameter is present, and if it is, it places the UID inside the url and then inserts an image tag on the page, with the completed URL as the src
attribute.
The users browser will then take care of calling that URL for us.
Always ask your tech team to verify our URL is being called successfully via their browsers networking panel.
Testing¶
In order to check that our pixels are correctly integrated on your site, you need to confirm the URL is called, and returns a http 200
status code.
You can do this from your browsers developers tools, inside the Network
tab.
Start by navigating to your page where you have implemented our pixel.
In Chrome, you can load the network panel by following these instructions:
- Select the View menu
- Under the Developer menu item, select Developer Tools
- In the panel that opens, select the tab titled Network
Once you have the panel open, enter the term leandigitalmedia.com
in the filter field. This will ensure we are only keeping an eye out for the tracking pixels we are testing.
You are now ready to start testing.
Tests that you need to pass¶
Action | Pass criteria |
---|---|
Refresh your page as it is | You should see nothing appear in the network activity panel, as there is no `uid` present in the URL |
Add ?uid=123 to the end of your URL, and hit return |
You should see a single entry appear in the network activity panel. The complete URL when you hover over should read: https://api.leandigitalmedia.com/v1/sp/ts/123/1 . The number of the end should be 1 to mark a user landing after clicking an ad, and the 123 part represents your site taking the UID from the URL and successfully placing into the pixel URL before calling. Finally, The status column should read 200 confirming we got your request and processed it. |
Complete your form and submit it | You should now see a new entry appear in the network activity panel. The complete URL when you hover over should read: https://api.leandigitalmedia.com/v1/sp/ts/123/2 . The number at the end should this time read 2 to mark a user completing a form fill. Then just as before you should see 123 and the status of 200 . |
Parallel Tracking¶
Some platforms support, (or even enforce) the use of parallel tracking. This method controls the way technology companies track users, prevents abuse of power and ensures tracking does not negatively effect the users experience.
Lean Digital Medias tracking technology fully supports parallel tracking.
How does it work?¶
With parallel tracking, customers are delivered directly to your landing page while click measurement happens in the background.
Here’s what parallel tracking looks like:
- Customer clicks your ad.
- Customer sees your landing page.
At the same time, in the background:
- Platform click tracker loads.
- Tracking URL loads.
Without parallel tracking, customers go through one or more redirects after clicking your ad before they reach your landing page. This means that it takes longer for customers to reach your landing page.
Here’s what tracking looks like without parallel tracking:
- Customer clicks your ad.
- Platform click tracker loads.
- Tracking URL loads.
- Customer sees your landing page.
You will know parallel tracking is in effect when the UID on your landing page is non-numeric. e.g. ?uid=google_CjwKCAjwlID8BRAFEiwAnUoK1V5jhbo6zmcIJZFZRKW5-CRoCwp8QAvD_Bw
Most importantly, no additional work is required to support parallel tracking. Simply pass the UID through in your stage pixel calls as you normally do. Easy!