This article applies to customers who have the legacy version of Scaleo.
Please visit our new Help Center.
This is a great tool for fast generating of JavaScript tracking pixels, fully adjustable for your demands.
It can be helpful for the following situations:
- Advertiser supports only JavaScript pixels
- The pixel should fire on specific site page only
- The pixel should fire if some text exists on the page
- The pixel should fire if some link or button clicked (for example Call Now button)
Find this functionality under admin/managers access at the Tools -> Smart Pixels tab (if you don't see this option, please contact Scaleo support to activate this feature)
Setup
Press the Add button and proceed with setting up all needed parameters, as follows.
- Fill in the Title
- Select the offer and the offer's goal (the feature is not available for offers with a CPC goal only)
- Choose the tracking type: Cookie or Postback URL
- Add conditions, which are requred for the pixel to be fired
- Set any Additional JavaScript code, which will be added to the final pixel, if needed
Let's stop on major steps in details.
Switching from Cookie to Postback URL tracking type enables an aditional Click ID tracking parameter to be available:
At the same time the Track ID parameter is available by default for both tracking types.
How it works
Each parameter could be reached and extracted from the HTML code on your page, by using these basic HTML attributes:
- id
- name
- class
All you need is to choose the one, which suits best:
Let's imagine, our conversion page has the next HTML tag, containing the Track ID value, which we need to put in our pixel: <input type="hidden" id="idTrackID" name="pxTrackId" class="classTrackID" value="test_track_id">
In our example we can reach such a tag with any available HTML attribute. Let's say, we need to reach it with the name attribute, as it will fully satisfy our virtual example's needs :)
So we take the value from the "name" attribute and just put it in the corresponding field of our Smart Pixel's adjustment:
That's it. Now the pixel will receive the "test_track_id" value from the needed HTML tag into the Track ID parameter.
The Click ID for Postback URL could be retreived in the similar way.
Conditions
Use this section to add several conditions, if you need to prevent pixel from firing in some specific cases. You can add three of them:
- HTML text. This condition will enable JavaScript for searching any text on the HTML page. When the text is found, the pixel is allowed to be fired
- Specific URL. This checks whether the conversion page's URL is formated in a valid way (e.g. has a valid set of parameters, text expressions etc.)
- Click. Use this to add a JavaScript click event to any button or HTML element on your conversion page. Use id, name, class attributes to reach the HTML element as in the example above. When added, the script will require user's click on the selected element in order for pixel to be fired
You can add all three conditions or none of them, though you can use one type of the condition only once.
Pixel will be executed, if it satisfies all added conditions:
Additional JavaScript
Put the desired JS code here, if you need to add some more functionality to your pixel:
Result Code
You'll get a simple code to be added on your conversion page after all:
The code in the JS-file will look like that:
function pixel() { var trackObj = document.getElementsByName('pxTrackId'); var track_id = trackObj.length > 0 ? trackObj[0].value : ''; if (track_id == undefined) { track_id = trackObj[0].innerText; }; var ifr = document.createElement('iframe'); ifr.src = 'https://testdemo.scaleo-up.com/track/goal-iframe?goal_id=34' + '&track_id=' + track_id; ifr.width = 1; ifr.height = 1; ifr.frameBorder = 0; var pixelOk = "Yes, everything goes ok )"; console.log(pixelOk); document.body.appendChild(ifr); }; if (window.location.href.indexOf('?url=conversion&status=approved') > -1 && (document.documentElement.innerText.indexOf('This text approves the lead') > -1)) { document.getElementsByClassName('classEventClick')[0].onclick = function() { pixel(); } }