You can make this happen with the javascript APIHere's how you go about it.


1) Click on Customize for Desktop under Settings on your dashboard


Firstly, go to your PushCrew dashboard. On the left side of the panel, click on Settings. From the drop down that will appear, click on  Customize for Desktop page. 






2) Uncheck ‘Display push notifications permission box after 5 seconds on your website.'


Now, uncheck the option "Display push notifications permission box after 5 seconds on your website." At this point, there shouldn’t be any opt-in box.






3) Inspect your desired web page


Open your website, in a new tab. Open the page you want the opt-in to trigger. Now, right click anywhere on the webpage. A box will open. Select the Inspect option.






4) Click on Console option


After executing the previous step, on the top left, you will now see a few options. From these, click on Console, as shown in the image below.






5) Copy-paste the javascript code to the console and press enter


You will now see blank space. Copy the below mentioned Javascript code as is, and paste in in this blank space of console.



1

2

3

4

5

6

7

8

window._pcq = window._pcq || [ ];

window._pcq.push(['triggerOptIn',

 { subscriberSegment: 'homepage',

 modal: {

 text: 'Get instant alerts from our website. Please subscribe.',

 blackenBackground: true

 }

 }]);



Now, press Enter. Please refer to the image below to get a better picture.







6) Opt-in trigger success notification


  • You will now see certain words and lines highlighted in red, that indicates that you have successfully triggered opt-in from your own button. You’ll see this in the circled area, in the image below.

  • Also, on the top left of the taskbar, next to the URL of your web page, you will see an opt-in box. It is highlighted in the red box, in the image below.

  • On the bottom left of the window, you will also see a message that says “Get alerts from our website. Please subscribe”. In the image below, it has an arrow pointing to it.  






Please note: In case you want multiple pages of your website to trigger an opt-in, open those pages and follow steps 3 to 6.


 



For those using jQuery libray


If you want to trigger this, when the user clicks a button, with CSS class ".keep-in-touch", you'd want to do the following.




1

2

3

4

5

6

7

8

9

10

$(".keep-in-touch").click(function() {

 window._pcq = window._pcq || [ ];

 window._pcq.push(['triggerOptIn',

 { subscriberSegment: 'homepage',

 modal: {

 text: 'Get instant alerts from our website. Please subscribe.',

 blackenBackground: true

 }

 }]);

 });