• I am developing a web application (let’s call it myapp.com) that needs to do the following:
    1) Read a hyperlink that points to any webpage (say, customersite.com);
    2) Access the code under customersite.com, which is probably a php file;
    3) Add a code snippet (a google tag script) into the header of the main php file under customersite.com.

    Assuming customersite com is build using WordPress, I suppose I would need WordPress API to do 2 and 3. So, my question is:

    Is it possible to programmatically add a code snipped into the page of websites of which I’m not admin? If possible, what permissions need to be given from customersite.com to myapp.com?

    • This topic was modified 2 years, 9 months ago by backside9724.
    • This topic was modified 2 years, 9 months ago by backside9724.
    • This topic was modified 2 years, 9 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • There’s no built-in way for WordPress to do that. As I’m sure you can imagine, opening that up would be a pretty huge security issue.

    The only way that I can see this happenng is for you to get every remote site to set up a user account on that site with administrator access and then make some HTTP cals to the right URL’s to log in and navigate to the theme editor area and modify the header template file.

    And that’s only if the site allows that, some dont.

    To be honest, the best idea is to tell people to add a small code smipet to their site when they sign up for your service. That means that it’s up to them to do, and you don’t need any access to their sites.

    Thread Starter backside9724

    (@backside9724)

    Thanks a lot for the reply! Yes, I totally get the security issue. Your suggestion is probably the best way to operate this. Thank you very much for the feedback.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add a Google’s conversion tag into client webpage without admin access’ is closed to new replies.