How can we help?

If you are looking for support for our PokaTheme, this is the place!

Home Forums PokaTheme support dynamic affiliate link for an advertising

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #17526
    Okaay
    Participant

    Hello, friends!
    Tell me how to make a dynamic affiliate link for an advertising network?
    Example:
    https://limmancasinogames.com/br/?gclid=test

    you can also see that the “gclid=test” parameter is written automatically to each offer

    how to do it on my website?

    #17529
    admin
    Keymaster

    Hi Okaay,

    Did you try with the above link and you faced any problems? Could you provide us with more details?

    #17557
    Okaay
    Participant

    ok i will try now

    #17559
    Okaay
    Participant

    When a user clicks on an ad, they get this URL:
    limmancasinogames.com/br/?gclid=test

    where parameter “test” is a random variable.

    Therefore, all links to pages should look with this additional parameter (as shown in the example): “gclid=test”
    limmancasinogames.com/go?c=leonbets&trk=1359&gclid=test

    If in the example I did not indicate my site, but the site that correctly makes links on the page

    #17561
    admin
    Keymaster

    Hi Okaay,

    I think this is related to Google Ads, right?

    I understand that you want, each time someone is visiting your site (example.com) from a Google Ad, so he sees a link like “example.com?gclid=TEST”, to keep this “?gclid=TEST” parameter throughout the site, right?

    I think this is a settings in Google Ads named “Auto-Tagging” about which you can find more info here: https://support.google.com/google-ads/answer/1033981?hl=en#zippy=%2Cin-this-article

    #17563
    Okaay
    Participant

    All right

    When a user clicks on an ad, I get this link:
    “example.com?gclid=TEST”

    but affiliate links on the page are already displayed without a parameter “?gclid=TEST”

    just like that:
    “example.com/go/site1”
    “example.com/go/site2”
    “example.com/go/site3”

    but it should be like this:
    “example.com/go/site1?gclid=TEST”
    “example.com/go/site2?gclid=TEST”
    “example.com/go/site3?gclid=TEST”

    #17568
    admin
    Keymaster

    Hi Okaay,

    You could do this by copy paste the following PHP snippet inside your functions.php of your child theme.

    function poka_child_63d782cf07e98( $link ) {
    	if ( isset( $_GET['gclid'] ) && sanitize_text_field( $_GET['gclid'] ) ) {
    		$link = add_query_arg(
    			array(
    				'gclid' => sanitize_text_field( $_GET['gclid'] ),
    			),
    			$link
    		);
    	}
    	return $link;
    }
    
    #17574
    Okaay
    Participant

    I tried but the link didn’t change when I clicked on this link “example.com?gclid=TEST”

    links were normal, without additional parameter “gclid=TEST”

    like that:
    “example.com/go/site1”

    #17578
    admin
    Keymaster

    Hi Okaay,

    This is weird, because I tried the snippet again and it worked.

    Please send us an email at support@pokatheme.com with your site details so that we have a specific look.

    #17590
    admin
    Keymaster

    Hi all,

    Here is the updated PHP snippet (the 1st line was missing before):

    add_filter( 'poka_affiliate_link', 'poka_child_63d782cf07e98' );
    function poka_child_63d782cf07e98( $link ) {
    	if ( isset( $_GET['gclid'] ) && sanitize_text_field( $_GET['gclid'] ) ) {
    		$link = add_query_arg(
    			array(
    				'gclid' => sanitize_text_field( $_GET['gclid'] ),
    			),
    			$link
    		);
    	}
    	return $link;
    }
    
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.