Mobile app version of vmapp.org
Login or Join
Cugini213

: Adding UTM parameters in WhatsApp share button, how? I'm using this code to generate the WhatsApp share button: <a href="whatsapp://send?text=<?php echo get_the_title(); ?> <?php echo get_post_permalink();

@Cugini213

Posted in: #UtmParameters #Wordpress

I'm using this code to generate the WhatsApp share button:

<a href="whatsapp://send?text=<?php echo get_the_title(); ?> <?php echo get_post_permalink(); ?>">Share via Whatsapp</a>


I want to add also ?utm_source=whatsapp in the URL.

How can I achieve this?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cugini213

2 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

You should url encode the = to %3D and it will work.
And any & to %26.

10% popularity Vote Up Vote Down


 

@Lee4591628

I guess you're using WordPress based on the get_post_permalink() so try replacing <?php echo get_post_permalink(); ?> with <?php echo get_post_permalink().'?utm_source=whatsapp'; ?> to append the attribute onto the link.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme