Snippets

Nudge Example code for adding on page Interactions

Updated by Izac Hancock

File Example interactions.html Modified

  • Ignore whitespace
  • Hide word diff
 <a href="#" onclick="ndg('Link Click');">Click Here</a>
 
 <!-- Track Mouse Over & Mouse Out interactions -->
-<img onmouseover="ndg('Img Mouse Over')" onmouseout="('Img Mouse Out')" border="0" src="https://picsum.photos/200">
+<img onmouseover="ndg('Img Mouse Over')" onmouseout="ndg('Img Mouse Out')" border="0" src="https://picsum.photos/200">
 
 
Created by Izac Hancock

File Example interactions.html Added

  • Ignore whitespace
  • Hide word diff
+<!-- Nudge tracking Code 
+
+<script src="https://cdn.ndg.io/ndg-XXXXXXXX.js" async></script> 
+
+Make sure you change the Nudge Tracking Script to your own. If you are unsure how to get this, contact support@giveitanudge.com or using the helper button on support.giveitanudge.com -->
+
+<!-- Interaction Examples -->
+
+<!--Track a button click as an interaction -->
+<button onclick="ndg('Button Click');">Button Click</button>
+
+<!-- Track a link click as an interaction -->
+<a href="#" onclick="ndg('Link Click');">Click Here</a>
+
+<!-- Track Mouse Over & Mouse Out interactions -->
+<img onmouseover="ndg('Img Mouse Over')" onmouseout="('Img Mouse Out')" border="0" src="https://picsum.photos/200">
+
+
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.