Pay with a Plus

Popup a download link

Using this example we can popup a download link when the user clicks the +1 button.

Example

+1 to get your download link!

The code

Inside the <head> tag on your page, place the following (ideally just before the closing </head> tag). Download the required files on GitHub.

					<link type="text/css" rel="stylesheet" href="PATHTO/paywithaplus.css" />
					<script type="text/javascript" src="PATHTO/paywithaplus.min.js"></script>
					<script type="text/javascript">
		
						function paywithaplus(data) {
							var x = new $.payWithAPlusPlugin({
					
								popupLink: 'download.pdf',
								popupCopy: 'Thanks! Grab your download link...',
								popupLinkCopy: 'Download here',
								displaySpeed: 500,
								
								// Push this as an event GA?
								pushToAnalytics: true,
								customPushEvent: 'PayWithAPlus', 
								
								// Do not edit below this line...
								buttonPush: data.state,
								buttonHREF: data.href
						
							});
						}
						
					</script>
				

A quick explanation

This will probably make better sense if you've read the blog post, but here's a quick explanation (the blog post should explain the CSS better). Firstly we're including the css file, then including the script. Note the PATHTO (ie, where you've put it). Also note you should have already included jQuery. There are 6 settings here that we can customise. As above, each one needs a comma after it. The only things you need to include are listed in bold.

Back to the index...
Back to the blog post...