Specifying Popup Display with Javascript
In campaign settings, you can display popups at the appropriate timing in accordance with user actions on your site. Among these options, there is a method to control the timing of popups and fixed bars even more freely using Javascript code. We will explain this in detail below.
INFO Note: Control via Javascript code applies only to popups and fixed bars, and does not apply to site editing. Additionally, you can trigger it multiple times within one session.
Configuration Method
As shown in the attached image, after creating the creative, select display by Javascript code in the settings of "Display/Stop Conditions".
You can control the firing of popups or fixed bars using Javascript code like the following: ptengine && ptengine.showEngagement('xxxxxxxx');
Note:
The ID code differs for each creative, device, and pattern, so always obtain the correct one.
When performing A/B tests, you need to implement all the codes for each pattern.
When setting up campaigns on both PC and SP (smartphone) devices, you need to implement all the codes for each device.
Copy the Javascript code, implement it on the page where you want to display it, and trigger it at the timing you want to display.
Complete the campaign settings and save.
Implementation Examples
When adding to HTML <button id="loginBtn" onclick="ptengine && ptengine.showEngagement('xxxxxxxx')">login</button>
When adding to native Javascript document.getElementById("loginBtn").addEventListener("click", function(){ ptengine && ptengine.showEngagement('xxxxxxxx) });
最終更新