Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonathan 1 post 71 karma points
    Apr 25, 2019 @ 11:48
    Jonathan
    0

    Dynamically Change H1 based on a user's location

    I am trying to dynamically change the H1 on my landing page depending on a searcher's location when landing on the page from a Google Ad.

    I would like the location of the searcher to be dynamically inserted into the H1 (from Google Ads traffic). So, for example, if someone searches for 'my services' and they are in London (and click my Google Ad) then the H1 will show 'my services London'.

    Is anyone aware of a way to do this or if it is even possible with Umbraco? Google Ads can dynamically insert a user's location into ad copy (based of the IP address I'm assuming) so surely it must be possible within an H1.

    Any advice is greatly appreciated.

  • Kerri Mallinson 113 posts 497 karma points
    Apr 25, 2019 @ 16:46
    Kerri Mallinson
    0

    Hi Jonathan,

    You might be able to get the users location from Google Ads by using ValueTrack Parameters, these can be added to final url (i think {loc_physical_ms} will get google's ID for the location)

    More info on this here: https://support.google.com/google-ads/answer/6305348

    A look up of Values relating to the ID's is here: https://developers.google.com/adwords/api/docs/appendix/geotargeting

    Alternatively you could use a geocoding API to get the location from IP Address: https://stackoverflow.com/questions/4327629/get-user-location-by-ip-address , however it's worth noting that IP address location isn't 100% accurate (especially on mobile devices), at least using the google ID should give consistency between the Ad they clicked and the landing page.

    Once you've got the location you can store it in cookie for use throughout the site (depending on opt ins, GDPR etc...)

    Good Luck!

    Kerri

Please Sign in or register to post replies

Write your reply to:

Draft