Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- This is a simple link with a custom Whatsapp text, here the official doc.
EN Resource: https://faq.whatsapp.com/iphone/how-to-link-to-whatsapp-from-a-different-app/?lang=en
IT Resource: https://faq.whatsapp.com/iphone/how-to-link-to-whatsapp-from-a-different-app/?lang=it
--> 
<a href="https://wa.me/3381078834?text=Hello%world">Send whatsapp text</a>

              
            
!

CSS

              
                /* Optional CSS */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@900&display=swap');
body {
  width:100%; 
  background:#25d366;
  margin:0;
  padding:0;
  color: #FFF;
  font-weight:200;
}
a {
  width:400px;
  text-decoration:none;
  display:block;
  margin:40px auto;
  font-size:2em;
  color: #FFF;
  font-family:'Roboto';
}
a:hover {
  text-decoration:underline;
}
              
            
!

JS

              
                //You may put this code in a jQuery document ready function
//Current URL variable, it takes the full URL with UTM or clic ID
CurrentURL = window.location.href;

/* UTM or Clic ID checker, just put the source you want to track here, 
you can also do a simple A or B text with gclid and fbclid instead of UTM campaign and source,
enjoy! */

/*Text vars is made so: 
Hi, I have seen the {CAMPAIGN SOURCE} offer and I would like
to receive special prices on {CAMPAIGN NAME}. 
Promo code: 
F2AX -------> F is for Facebook source, 2 is for Adset number 2, A is for Test A maybe, X for for whatever you want.
Promo code is just a plus or it could be the only thing to send, do whatever you want.
This is just a choice of marketing, you pick one based on your own business :-)
*/
//Set the Texts here
//Default text is used when the script doesn't find the UTM
var myDefaultText = "YOUR_DEFAULT_TEXT_HERE";
/*This example text is used when UTM source is Google
The plain text is: Hi, I saw the Google offer and I would like 
to receive special prices on SEO training courses. Promo code: G2AX */
var myFirstCampaignText ="Hi,%20I%20saw%20the%20Google%20offer%20and%20I%20would%20like%20to%20receive%20special%20prices%20on%20SEO%20training%20courses.%20Promo%20code:%20G2AX";
/*This example text is used when UTM source is Facebook
The plain text is: Hi, I saw the Facebook offer and I would like 
to receive special prices on Facebook training courses. Promo code: G2AX */
var mySecondCampaignText = "Hi,%20I%20saw%20the%20Google%20offer%20and%20I%20would%20like%20to%20receive%20special%20prices%20on%20Facebook%20training%20courses.%20Promo%20code:%20F2AX";
watext ="";

//This check if the current URL contain the UTM campaign
	if(CurrentURL.indexOf("google") >= 0)
	{
		//This is the "default" text of message
		watext = "https://wa.me/393451560384?text=" + myDefaultText;
		
		//This check if the URL containing the UTM campaign contains also the custom UTM source "my_first_campaign_name"
		if(CurrentURL.indexOf("seocourse") >= 0)
		{
			watext = "https://wa.me/393451560384?text=" + myFirstCampaignText;
		}	
		//This check if the URL containing the UTM campaign contains also the custom UTM source "my_second_campaign_name"
		if(CurrentURL.indexOf("facebookcourse") >= 0)
		{
			watext = "https://wa.me/393451560384?text=" + mySecondCampaignText;
		}
	}
$("a").attr("href", watext);
console.log(watext);

  
              
            
!
999px

Console